Problem with is_active_sidebar?

Please try this one,because without id we i don’t think that will work: function reg_l_sid() { $args = array( ‘id’ => ‘sidebar-footer-6’,’name’=> ‘Left-sidebar’); register_sidebar($args); } add_action(‘widgets_init’, ‘reg_l_sid’); and inside template: if (is_active_sidebar(‘sidebar-footer-6’)) { dynamic_sidebar(‘sidebar-footer-6’); } else { echo ‘Please add widgets’; }

Obtain full v2 REST url?

You could add the path argument to the get_rest_url() function as per the WordPress Developer docs – https://developer.wordpress.org/reference/functions/get_rest_url/ – in order to get the path you need: get_rest_url( null, ‘wp/v2/’ ); This would produce: http://mywebsite.com/wp-json/wp/v2/

Use debugging for add action events

If you want to use debugging from an action where you won’t see the output, you can send things to error_log. First, you need to enable debug logging. In your /wp-config.php add the lines: define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_LOG’, true ); This will create a file called /wp-content/debug.log Next, in your code, add some … Read more

wp_editor() usage in custom meta box

This may not solve the problem, but I hope it helps you. In the sky_post_excerpts() function, I used this to display the TinyMCE/classic editor: (the $data is get_post_meta($post->ID, ‘skyscraper_post’, true)) <?php wp_editor( $data, ‘post_meta_box’, array(‘textarea_name’=>’skyscraper_post’)); ?> In the post_meta_box_save() function, I saved the meta like so, where $allowed is wp_kses_allowed_html(): update_post_meta( $post_id, ‘skyscraper_post’, wp_kses( $_POST[‘skyscraper_post’], … Read more

How to retrieve custom meta term of category taxonomy from WP Rest API?

First you need to tell WordPress to show this custom field in the API response: register_term_meta(‘category’, ‘_category_color’, [‘show_in_rest’ => true]); Then you can filter the category term API endpoint like so: add_filter( ‘rest_prepare_category’,function($response, $item, $request){ $color = get_term_meta( $item->term_id, ‘_category_color’, true ); $response->data[‘color’] = $color ?: ”; return $response; }, 10, 3);