F/** * Indicates if the currently-matched node expects a closing * token, or if it will self-close on the next step. * * Most HTML elements expect a closer, such as a P element or * a DIV element. Others, like an IMG element are void and don't * have a closing tag. Special elements, such as SCRIPT and STYLE, * are treated just like void tags. Text nodes and self-closing * foreign content will also act just like a void tag, immediately * closing as soon as the processor advances to the next token. * * @since 6.6.0 * * @param WP_HTML_Token|null $node Optional. Node to examine, if provided. * Default is to examine current node. * @return bool|null Whether to expect a closer for the currently-matched node, * or `null` if not matched on any token. */&n  Hi5/** * Indicates if the currently matched tag contains the self-closing flag. * * No HTML elements ought to have the self-closing flag and for those, the self-closing * flag will be ignored. For void elements this is benign because they "self close" * automatically. For non-void HTML elements though problems will appear if someone * intends to use a self-closing element in place of that element with an empty body. * For HTML foreign elements and custom elements the self-closing flag determines if * they self-close or not. * * This function does not determine if a tag is self-closing, * but only if the self-closing flag is present in the syntax. * * @since 6.6.0 Subclassed for the HTML Processor. * * @return bool Whether the currently matched tag contains the self-closing flag. */iiЖiiؘid!끔./** * Indicates the kind of matched token, if any. * * This differs from `get_token_name()` in that it always * returns a static string indicating the type, whereas * `get_token_name()` may return values derived from the * token itself, such as a tag name or processing * instruction tag. * * Possible values: * - `#tag` when matched on a tag. * - `#text` when matched on a text node. * - `#cdata-section` when matched on a CDATA node. * - `#comment` when matched on a comment. * - `#doctype` when matched on a DOCTYPE declaration. * - `#presumptuous-tag` when matched on an empty tag closer. * - `#funky-comment` when matched on a funky comment. * * @since 6.6.0 Subclassed for the HTML Processor. * * @return string|null What kind of token is matched, or null. */(i@8$n  @id!/** * Returns the value of a requested attribute from a matched tag opener if that attribute exists. * * Example: * * $p = WP_HTML_Processor::create_fragment( '
Test
' ); * $p->next_token() === true; * $p->get_attribute( 'data-test-id' ) === '14'; * $p->get_attribute( 'enabled' ) === true; * $p->get_attribute( 'aria-label' ) === null; * * $p->next_tag() === false; * $p->get_attribute( 'class' ) === null; * * @since 6.6.0 Subclassed for HTML Processor. * * @param string $name Name of attribute whose value is requested. * @return string|true|null Value of attribute or `null` if not available. Boolean attributes return `true`. */ hi@#n  ii pii iXiid!눔/** * Moves the internal cursor in the HTML Processor to a given bookmark's location. * * Be careful! Seeking backwards to a previous location resets the parser to the * start of the document and reparses the entire contents up until it finds the * sought-after bookmarked location. * * In order to prevent accidental infinite loops, there's a * maximum limit on the number of times seek() can be called. * * @throws Exception When unable to allocate a bookmark for th* @return bool Whether the term is viewable or not. */ protected function is_term_viewable( $term_taxonomy_id ) { $term = get_term_by( 'term_taxonomy_id', (int) $term_taxonomy_id ); if ( ! $term || is_wp_error( $term ) ) { return false; } $taxonomy = get_taxonomy( $term->taxonomy ); if ( ! $taxonomy ) { return false; } return $taxonomy->publicly_queryable || $taxonomy->public; } /** * Gets the taxonomy label to use for a term. * * @param int $term_id The term ID. * * @return string The taxonomy's singular label. */ protected function get_taxonomy_label_for_term( $term_id ) { $term = get_term( $term_id ); $taxonomy = get_taxonomy( $term->taxonomy ); return $taxonomy->labels->singular_name; } /** * Retrieves the singular post type label. * * @param string $post_type Post type to retrieve label from. * * @return string The singular post type name. */ protected function get_post_type_label( $post_type ) { $post_type_object = get_post_type_object( $post_type ); // If the post type of this post wasn't registered default back to post. if ( $post_type_object === null ) { $post_type_object = get_post_type_object( 'post' ); } return $post_type_object->labels->singular_name; } /** * Checks whether the given post status is visible or not. * * @param string $post_status The post status to check. * * @return bool Whether or not the post is visible. */ protected function check_visible_post_status( $post_status ) { $visible_post_statuses = [ 'publish', 'static', 'private', ]; return in_array( $post_status, $visible_post_statuses, true ); } /** * Returns the message around changed URLs. * * @param string $first_sentence The first sentence of the notification. * @param string $second_sentence The second sentence of the notification. * * @return string The full notification. */ protected function get_message( $first_sentence, $second_sentence ) { return '

' . __( 'Make sure you don\'t miss out on traffic!', 'wordpress-seo' ) . '

' . '

' . $first_sentence . ' ' . $second_sentence . ' ' . __( 'You should create a redirect to ensure your visitors do not get a 404 error when they click on the no longer working URL.', 'wordpress-seo' ) /* translators: %s expands to Yoast SEO Premium */ . ' ' . sprintf( __( 'With %s, you can easily create such redirects.', 'wordpress-seo' ), 'Yoast SEO Premium' ) . '

' . '

' /* translators: %s expands to Yoast SEO Premium */ . sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ) /* translators: Hidden accessibility text. */ . '' . __( '(Opens in a new browser tab)', 'wordpress-seo' ) . '' . '' . '

'; } /** * Adds a notification to be shown on the next page request since posts are updated in an ajax request. * * @param string $message The message to add to the notification. * * @return void */ protected function add_notification( $message ) { $notification = new Yoast_Notification( $message, [ 'type' => 'notice-warning is-dismissible', 'yoast_branding' => true, ] ); $notification_center = Yoast_Notification_Center::get(); $notification_center->add_notification( $notification ); } }