Edit File by line
/home/zeestwma/redstone.../wp-inclu.../blocks
File: navigation-link.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Server-side registering and rendering of the `core/navigation-link` block.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Build an array with CSS classes and inline styles defining the colors
[8] Fix | Delete
* which will be applied to the navigation markup in the front-end.
[9] Fix | Delete
*
[10] Fix | Delete
* @since 5.9.0
[11] Fix | Delete
*
[12] Fix | Delete
* @param array $context Navigation block context.
[13] Fix | Delete
* @param array $attributes Block attributes.
[14] Fix | Delete
* @param bool $is_sub_menu Whether the link is part of a sub-menu. Default false.
[15] Fix | Delete
* @return array Colors CSS classes and inline styles.
[16] Fix | Delete
*/
[17] Fix | Delete
function block_core_navigation_link_build_css_colors( $context, $attributes, $is_sub_menu = false ) {
[18] Fix | Delete
$colors = array(
[19] Fix | Delete
'css_classes' => array(),
[20] Fix | Delete
'inline_styles' => '',
[21] Fix | Delete
);
[22] Fix | Delete
[23] Fix | Delete
// Text color.
[24] Fix | Delete
$named_text_color = null;
[25] Fix | Delete
$custom_text_color = null;
[26] Fix | Delete
[27] Fix | Delete
if ( $is_sub_menu && array_key_exists( 'customOverlayTextColor', $context ) ) {
[28] Fix | Delete
$custom_text_color = $context['customOverlayTextColor'];
[29] Fix | Delete
} elseif ( $is_sub_menu && array_key_exists( 'overlayTextColor', $context ) ) {
[30] Fix | Delete
$named_text_color = $context['overlayTextColor'];
[31] Fix | Delete
} elseif ( array_key_exists( 'customTextColor', $context ) ) {
[32] Fix | Delete
$custom_text_color = $context['customTextColor'];
[33] Fix | Delete
} elseif ( array_key_exists( 'textColor', $context ) ) {
[34] Fix | Delete
$named_text_color = $context['textColor'];
[35] Fix | Delete
} elseif ( isset( $context['style']['color']['text'] ) ) {
[36] Fix | Delete
$custom_text_color = $context['style']['color']['text'];
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
// If has text color.
[40] Fix | Delete
if ( ! is_null( $named_text_color ) ) {
[41] Fix | Delete
// Add the color class.
[42] Fix | Delete
array_push( $colors['css_classes'], 'has-text-color', sprintf( 'has-%s-color', $named_text_color ) );
[43] Fix | Delete
} elseif ( ! is_null( $custom_text_color ) ) {
[44] Fix | Delete
// Add the custom color inline style.
[45] Fix | Delete
$colors['css_classes'][] = 'has-text-color';
[46] Fix | Delete
$colors['inline_styles'] .= sprintf( 'color: %s;', $custom_text_color );
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
// Background color.
[50] Fix | Delete
$named_background_color = null;
[51] Fix | Delete
$custom_background_color = null;
[52] Fix | Delete
[53] Fix | Delete
if ( $is_sub_menu && array_key_exists( 'customOverlayBackgroundColor', $context ) ) {
[54] Fix | Delete
$custom_background_color = $context['customOverlayBackgroundColor'];
[55] Fix | Delete
} elseif ( $is_sub_menu && array_key_exists( 'overlayBackgroundColor', $context ) ) {
[56] Fix | Delete
$named_background_color = $context['overlayBackgroundColor'];
[57] Fix | Delete
} elseif ( array_key_exists( 'customBackgroundColor', $context ) ) {
[58] Fix | Delete
$custom_background_color = $context['customBackgroundColor'];
[59] Fix | Delete
} elseif ( array_key_exists( 'backgroundColor', $context ) ) {
[60] Fix | Delete
$named_background_color = $context['backgroundColor'];
[61] Fix | Delete
} elseif ( isset( $context['style']['color']['background'] ) ) {
[62] Fix | Delete
$custom_background_color = $context['style']['color']['background'];
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
// If has background color.
[66] Fix | Delete
if ( ! is_null( $named_background_color ) ) {
[67] Fix | Delete
// Add the background-color class.
[68] Fix | Delete
array_push( $colors['css_classes'], 'has-background', sprintf( 'has-%s-background-color', $named_background_color ) );
[69] Fix | Delete
} elseif ( ! is_null( $custom_background_color ) ) {
[70] Fix | Delete
// Add the custom background-color inline style.
[71] Fix | Delete
$colors['css_classes'][] = 'has-background';
[72] Fix | Delete
$colors['inline_styles'] .= sprintf( 'background-color: %s;', $custom_background_color );
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
return $colors;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
/**
[79] Fix | Delete
* Build an array with CSS classes and inline styles defining the font sizes
[80] Fix | Delete
* which will be applied to the navigation markup in the front-end.
[81] Fix | Delete
*
[82] Fix | Delete
* @since 5.9.0
[83] Fix | Delete
*
[84] Fix | Delete
* @param array $context Navigation block context.
[85] Fix | Delete
* @return array Font size CSS classes and inline styles.
[86] Fix | Delete
*/
[87] Fix | Delete
function block_core_navigation_link_build_css_font_sizes( $context ) {
[88] Fix | Delete
// CSS classes.
[89] Fix | Delete
$font_sizes = array(
[90] Fix | Delete
'css_classes' => array(),
[91] Fix | Delete
'inline_styles' => '',
[92] Fix | Delete
);
[93] Fix | Delete
[94] Fix | Delete
$has_named_font_size = array_key_exists( 'fontSize', $context );
[95] Fix | Delete
$has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
[96] Fix | Delete
[97] Fix | Delete
if ( $has_named_font_size ) {
[98] Fix | Delete
// Add the font size class.
[99] Fix | Delete
$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
[100] Fix | Delete
} elseif ( $has_custom_font_size ) {
[101] Fix | Delete
// Add the custom font size inline style.
[102] Fix | Delete
$font_sizes['inline_styles'] = sprintf(
[103] Fix | Delete
'font-size: %s;',
[104] Fix | Delete
wp_get_typography_font_size_value(
[105] Fix | Delete
array(
[106] Fix | Delete
'size' => $context['style']['typography']['fontSize'],
[107] Fix | Delete
)
[108] Fix | Delete
)
[109] Fix | Delete
);
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
return $font_sizes;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
/**
[116] Fix | Delete
* Returns the top-level submenu SVG chevron icon.
[117] Fix | Delete
*
[118] Fix | Delete
* @since 5.9.0
[119] Fix | Delete
*
[120] Fix | Delete
* @return string
[121] Fix | Delete
*/
[122] Fix | Delete
function block_core_navigation_link_render_submenu_icon() {
[123] Fix | Delete
return '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>';
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
/**
[127] Fix | Delete
* Decodes a url if it's encoded, returning the same url if not.
[128] Fix | Delete
*
[129] Fix | Delete
* @since 6.2.0
[130] Fix | Delete
*
[131] Fix | Delete
* @param string $url The url to decode.
[132] Fix | Delete
*
[133] Fix | Delete
* @return string $url Returns the decoded url.
[134] Fix | Delete
*/
[135] Fix | Delete
function block_core_navigation_link_maybe_urldecode( $url ) {
[136] Fix | Delete
$is_url_encoded = false;
[137] Fix | Delete
$query = parse_url( $url, PHP_URL_QUERY );
[138] Fix | Delete
$query_params = wp_parse_args( $query );
[139] Fix | Delete
[140] Fix | Delete
foreach ( $query_params as $query_param ) {
[141] Fix | Delete
$can_query_param_be_encoded = is_string( $query_param ) && ! empty( $query_param );
[142] Fix | Delete
if ( ! $can_query_param_be_encoded ) {
[143] Fix | Delete
continue;
[144] Fix | Delete
}
[145] Fix | Delete
if ( rawurldecode( $query_param ) !== $query_param ) {
[146] Fix | Delete
$is_url_encoded = true;
[147] Fix | Delete
break;
[148] Fix | Delete
}
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
if ( $is_url_encoded ) {
[152] Fix | Delete
return rawurldecode( $url );
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
return $url;
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
[159] Fix | Delete
/**
[160] Fix | Delete
* Renders the `core/navigation-link` block.
[161] Fix | Delete
*
[162] Fix | Delete
* @since 5.9.0
[163] Fix | Delete
*
[164] Fix | Delete
* @param array $attributes The block attributes.
[165] Fix | Delete
* @param string $content The saved content.
[166] Fix | Delete
* @param WP_Block $block The parsed block.
[167] Fix | Delete
*
[168] Fix | Delete
* @return string Returns the post content with the legacy widget added.
[169] Fix | Delete
*/
[170] Fix | Delete
function render_block_core_navigation_link( $attributes, $content, $block ) {
[171] Fix | Delete
$navigation_link_has_id = isset( $attributes['id'] ) && is_numeric( $attributes['id'] );
[172] Fix | Delete
$is_post_type = isset( $attributes['kind'] ) && 'post-type' === $attributes['kind'];
[173] Fix | Delete
$is_post_type = $is_post_type || isset( $attributes['type'] ) && ( 'post' === $attributes['type'] || 'page' === $attributes['type'] );
[174] Fix | Delete
[175] Fix | Delete
// Don't render the block's subtree if it is a draft or if the ID does not exist.
[176] Fix | Delete
if ( $is_post_type && $navigation_link_has_id ) {
[177] Fix | Delete
$post = get_post( $attributes['id'] );
[178] Fix | Delete
/**
[179] Fix | Delete
* Filter allowed post_status for navigation link block to render.
[180] Fix | Delete
*
[181] Fix | Delete
* @since 6.8.0
[182] Fix | Delete
*
[183] Fix | Delete
* @param array $post_status
[184] Fix | Delete
* @param array $attributes
[185] Fix | Delete
* @param WP_Block $block
[186] Fix | Delete
*/
[187] Fix | Delete
$allowed_post_status = (array) apply_filters(
[188] Fix | Delete
'render_block_core_navigation_link_allowed_post_status',
[189] Fix | Delete
array( 'publish' ),
[190] Fix | Delete
$attributes,
[191] Fix | Delete
$block
[192] Fix | Delete
);
[193] Fix | Delete
if ( ! $post || ! in_array( $post->post_status, $allowed_post_status, true ) ) {
[194] Fix | Delete
return '';
[195] Fix | Delete
}
[196] Fix | Delete
}
[197] Fix | Delete
[198] Fix | Delete
// Don't render the block's subtree if it has no label.
[199] Fix | Delete
if ( empty( $attributes['label'] ) ) {
[200] Fix | Delete
return '';
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
$font_sizes = block_core_navigation_link_build_css_font_sizes( $block->context );
[204] Fix | Delete
$classes = array_merge(
[205] Fix | Delete
$font_sizes['css_classes']
[206] Fix | Delete
);
[207] Fix | Delete
$style_attribute = $font_sizes['inline_styles'];
[208] Fix | Delete
[209] Fix | Delete
$css_classes = trim( implode( ' ', $classes ) );
[210] Fix | Delete
$has_submenu = count( $block->inner_blocks ) > 0;
[211] Fix | Delete
$kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
[212] Fix | Delete
$is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind );
[213] Fix | Delete
[214] Fix | Delete
if ( is_post_type_archive() && ! empty( $attributes['url'] ) ) {
[215] Fix | Delete
$queried_archive_link = get_post_type_archive_link( get_queried_object()->name );
[216] Fix | Delete
if ( $attributes['url'] === $queried_archive_link ) {
[217] Fix | Delete
$is_active = true;
[218] Fix | Delete
}
[219] Fix | Delete
}
[220] Fix | Delete
[221] Fix | Delete
$wrapper_attributes = get_block_wrapper_attributes(
[222] Fix | Delete
array(
[223] Fix | Delete
'class' => $css_classes . ' wp-block-navigation-item' . ( $has_submenu ? ' has-child' : '' ) .
[224] Fix | Delete
( $is_active ? ' current-menu-item' : '' ),
[225] Fix | Delete
'style' => $style_attribute,
[226] Fix | Delete
)
[227] Fix | Delete
);
[228] Fix | Delete
$html = '<li ' . $wrapper_attributes . '>' .
[229] Fix | Delete
'<a class="wp-block-navigation-item__content" ';
[230] Fix | Delete
[231] Fix | Delete
// Start appending HTML attributes to anchor tag.
[232] Fix | Delete
if ( isset( $attributes['url'] ) ) {
[233] Fix | Delete
$html .= ' href="' . esc_url( block_core_navigation_link_maybe_urldecode( $attributes['url'] ) ) . '"';
[234] Fix | Delete
}
[235] Fix | Delete
[236] Fix | Delete
if ( $is_active ) {
[237] Fix | Delete
$html .= ' aria-current="page"';
[238] Fix | Delete
}
[239] Fix | Delete
[240] Fix | Delete
if ( isset( $attributes['opensInNewTab'] ) && true === $attributes['opensInNewTab'] ) {
[241] Fix | Delete
$html .= ' target="_blank" ';
[242] Fix | Delete
}
[243] Fix | Delete
[244] Fix | Delete
if ( isset( $attributes['rel'] ) ) {
[245] Fix | Delete
$html .= ' rel="' . esc_attr( $attributes['rel'] ) . '"';
[246] Fix | Delete
} elseif ( isset( $attributes['nofollow'] ) && $attributes['nofollow'] ) {
[247] Fix | Delete
$html .= ' rel="nofollow"';
[248] Fix | Delete
}
[249] Fix | Delete
[250] Fix | Delete
if ( isset( $attributes['title'] ) ) {
[251] Fix | Delete
$html .= ' title="' . esc_attr( $attributes['title'] ) . '"';
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
// End appending HTML attributes to anchor tag.
[255] Fix | Delete
[256] Fix | Delete
// Start anchor tag content.
[257] Fix | Delete
$html .= '>' .
[258] Fix | Delete
// Wrap title with span to isolate it from submenu icon.
[259] Fix | Delete
'<span class="wp-block-navigation-item__label">';
[260] Fix | Delete
[261] Fix | Delete
if ( isset( $attributes['label'] ) ) {
[262] Fix | Delete
$html .= wp_kses_post( $attributes['label'] );
[263] Fix | Delete
}
[264] Fix | Delete
[265] Fix | Delete
$html .= '</span>';
[266] Fix | Delete
[267] Fix | Delete
// Add description if available.
[268] Fix | Delete
if ( ! empty( $attributes['description'] ) ) {
[269] Fix | Delete
$html .= '<span class="wp-block-navigation-item__description">';
[270] Fix | Delete
$html .= wp_kses_post( $attributes['description'] );
[271] Fix | Delete
$html .= '</span>';
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
$html .= '</a>';
[275] Fix | Delete
// End anchor tag content.
[276] Fix | Delete
[277] Fix | Delete
if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) {
[278] Fix | Delete
// The submenu icon can be hidden by a CSS rule on the Navigation Block.
[279] Fix | Delete
$html .= '<span class="wp-block-navigation__submenu-icon">' . block_core_navigation_link_render_submenu_icon() . '</span>';
[280] Fix | Delete
}
[281] Fix | Delete
[282] Fix | Delete
if ( $has_submenu ) {
[283] Fix | Delete
$inner_blocks_html = '';
[284] Fix | Delete
foreach ( $block->inner_blocks as $inner_block ) {
[285] Fix | Delete
$inner_blocks_html .= $inner_block->render();
[286] Fix | Delete
}
[287] Fix | Delete
[288] Fix | Delete
$html .= sprintf(
[289] Fix | Delete
'<ul class="wp-block-navigation__submenu-container">%s</ul>',
[290] Fix | Delete
$inner_blocks_html
[291] Fix | Delete
);
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
$html .= '</li>';
[295] Fix | Delete
[296] Fix | Delete
return $html;
[297] Fix | Delete
}
[298] Fix | Delete
[299] Fix | Delete
/**
[300] Fix | Delete
* Returns a navigation link variation
[301] Fix | Delete
*
[302] Fix | Delete
* @since 5.9.0
[303] Fix | Delete
*
[304] Fix | Delete
* @param WP_Taxonomy|WP_Post_Type $entity post type or taxonomy entity.
[305] Fix | Delete
* @param string $kind string of value 'taxonomy' or 'post-type'.
[306] Fix | Delete
*
[307] Fix | Delete
* @return array
[308] Fix | Delete
*/
[309] Fix | Delete
function build_variation_for_navigation_link( $entity, $kind ) {
[310] Fix | Delete
$title = '';
[311] Fix | Delete
$description = '';
[312] Fix | Delete
[313] Fix | Delete
if ( property_exists( $entity->labels, 'item_link' ) ) {
[314] Fix | Delete
$title = $entity->labels->item_link;
[315] Fix | Delete
}
[316] Fix | Delete
if ( property_exists( $entity->labels, 'item_link_description' ) ) {
[317] Fix | Delete
$description = $entity->labels->item_link_description;
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
$variation = array(
[321] Fix | Delete
'name' => $entity->name,
[322] Fix | Delete
'title' => $title,
[323] Fix | Delete
'description' => $description,
[324] Fix | Delete
'attributes' => array(
[325] Fix | Delete
'type' => $entity->name,
[326] Fix | Delete
'kind' => $kind,
[327] Fix | Delete
),
[328] Fix | Delete
);
[329] Fix | Delete
[330] Fix | Delete
// Tweak some value for the variations.
[331] Fix | Delete
$variation_overrides = array(
[332] Fix | Delete
'post_tag' => array(
[333] Fix | Delete
'name' => 'tag',
[334] Fix | Delete
'attributes' => array(
[335] Fix | Delete
'type' => 'tag',
[336] Fix | Delete
'kind' => $kind,
[337] Fix | Delete
),
[338] Fix | Delete
),
[339] Fix | Delete
'post_format' => array(
[340] Fix | Delete
// The item_link and item_link_description for post formats is the
[341] Fix | Delete
// same as for tags, so need to be overridden.
[342] Fix | Delete
'title' => __( 'Post Format Link' ),
[343] Fix | Delete
'description' => __( 'A link to a post format' ),
[344] Fix | Delete
'attributes' => array(
[345] Fix | Delete
'type' => 'post_format',
[346] Fix | Delete
'kind' => $kind,
[347] Fix | Delete
),
[348] Fix | Delete
),
[349] Fix | Delete
);
[350] Fix | Delete
[351] Fix | Delete
if ( array_key_exists( $entity->name, $variation_overrides ) ) {
[352] Fix | Delete
$variation = array_merge(
[353] Fix | Delete
$variation,
[354] Fix | Delete
$variation_overrides[ $entity->name ]
[355] Fix | Delete
);
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
return $variation;
[359] Fix | Delete
}
[360] Fix | Delete
[361] Fix | Delete
/**
[362] Fix | Delete
* Filters the registered variations for a block type.
[363] Fix | Delete
* Returns the dynamically built variations for all post-types and taxonomies.
[364] Fix | Delete
*
[365] Fix | Delete
* @since 6.5.0
[366] Fix | Delete
*
[367] Fix | Delete
* @param array $variations Array of registered variations for a block type.
[368] Fix | Delete
* @param WP_Block_Type $block_type The full block type object.
[369] Fix | Delete
*/
[370] Fix | Delete
function block_core_navigation_link_filter_variations( $variations, $block_type ) {
[371] Fix | Delete
if ( 'core/navigation-link' !== $block_type->name ) {
[372] Fix | Delete
return $variations;
[373] Fix | Delete
}
[374] Fix | Delete
[375] Fix | Delete
$generated_variations = block_core_navigation_link_build_variations();
[376] Fix | Delete
return array_merge( $variations, $generated_variations );
[377] Fix | Delete
}
[378] Fix | Delete
[379] Fix | Delete
/**
[380] Fix | Delete
* Returns an array of variations for the navigation link block.
[381] Fix | Delete
*
[382] Fix | Delete
* @since 6.5.0
[383] Fix | Delete
*
[384] Fix | Delete
* @return array
[385] Fix | Delete
*/
[386] Fix | Delete
function block_core_navigation_link_build_variations() {
[387] Fix | Delete
$post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
[388] Fix | Delete
$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'objects' );
[389] Fix | Delete
[390] Fix | Delete
/*
[391] Fix | Delete
* Use two separate arrays as a way to order the variations in the UI.
[392] Fix | Delete
* Known variations (like Post Link and Page Link) are added to the
[393] Fix | Delete
* `built_ins` array. Variations for custom post types and taxonomies are
[394] Fix | Delete
* added to the `variations` array and will always appear after `built-ins.
[395] Fix | Delete
*/
[396] Fix | Delete
$built_ins = array();
[397] Fix | Delete
$variations = array();
[398] Fix | Delete
[399] Fix | Delete
if ( $post_types ) {
[400] Fix | Delete
foreach ( $post_types as $post_type ) {
[401] Fix | Delete
$variation = build_variation_for_navigation_link( $post_type, 'post-type' );
[402] Fix | Delete
if ( $post_type->_builtin ) {
[403] Fix | Delete
$built_ins[] = $variation;
[404] Fix | Delete
} else {
[405] Fix | Delete
$variations[] = $variation;
[406] Fix | Delete
}
[407] Fix | Delete
}
[408] Fix | Delete
}
[409] Fix | Delete
if ( $taxonomies ) {
[410] Fix | Delete
foreach ( $taxonomies as $taxonomy ) {
[411] Fix | Delete
$variation = build_variation_for_navigation_link( $taxonomy, 'taxonomy' );
[412] Fix | Delete
if ( $taxonomy->_builtin ) {
[413] Fix | Delete
$built_ins[] = $variation;
[414] Fix | Delete
} else {
[415] Fix | Delete
$variations[] = $variation;
[416] Fix | Delete
}
[417] Fix | Delete
}
[418] Fix | Delete
}
[419] Fix | Delete
[420] Fix | Delete
return array_merge( $built_ins, $variations );
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
/**
[424] Fix | Delete
* Registers the navigation link block.
[425] Fix | Delete
*
[426] Fix | Delete
* @since 5.9.0
[427] Fix | Delete
*
[428] Fix | Delete
* @uses render_block_core_navigation_link()
[429] Fix | Delete
* @throws WP_Error An WP_Error exception parsing the block definition.
[430] Fix | Delete
*/
[431] Fix | Delete
function register_block_core_navigation_link() {
[432] Fix | Delete
register_block_type_from_metadata(
[433] Fix | Delete
__DIR__ . '/navigation-link',
[434] Fix | Delete
array(
[435] Fix | Delete
'render_callback' => 'render_block_core_navigation_link',
[436] Fix | Delete
)
[437] Fix | Delete
);
[438] Fix | Delete
}
[439] Fix | Delete
add_action( 'init', 'register_block_core_navigation_link' );
[440] Fix | Delete
/**
[441] Fix | Delete
* Creates all variations for post types / taxonomies dynamically (= each time when variations are requested).
[442] Fix | Delete
* Do not use variation_callback, to also account for unregistering post types/taxonomies later on.
[443] Fix | Delete
*/
[444] Fix | Delete
add_action( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 );
[445] Fix | Delete
[446] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function