Customize Message
Those messages are specified in the labels argument to register_post_type(), there’s a full list of them here.
Those messages are specified in the labels argument to register_post_type(), there’s a full list of them here.
Presumably, within your Query Loop block, you also have a Post Template block. When rendering the page server side, there is “barrier” in the context inheritance caused by the render_block_core_post_template(): $block_content = ( new WP_Block( $block_instance ) )->render( array( ‘dynamic’ => false ) ); It renders the content without any of its context (it is … Read more
Walkers don’t have associated stylesheets. That’s not how they work. You need to load them separately by enqueuing the stylesheet in the wp_enqueue_scripts hook, as you’ve done in load_css(). The walker class gets used by setting the walker argument of wp_nav_menu() to an instance of the class when you’re rendering the menu in a template. … Read more
It depend if you’re using HPOS or not: If not: function my_custom_function_on_order_trash( $post_id ) { // Get the post type of the trashed item $post_type = get_post_type( $post_id ); // Check if the trashed item is an order if ( ‘shop_order’ === $post_type ) { // Your custom code here } } add_action( ‘wp_trash_post’, ‘my_custom_function_on_order_trash’ … Read more
because you don’t return JSON, you can use admin-post.php. create a hook like that : add_action(“admin_post_nopriv_MY_PLUGIN__answer”, function () { header(“Content-type: text/xml”); echo “<abc><def>1</def></abc>”; exit(); }); and then use the url /wp-admin/admin-post.php?action=MY_PLUGIN__answer. when you do debugging, don’t forget that admin_post_nopriv only answers on unconnected users then you can open the url in another browser.
There is no official public API to inject custom buttons into that area. This can be confirmed by inspecting the source code for this area, rendered by the DocumentTools component in the @wordpress/editor package. As alternatives, you could render a button to the right of the Save/Publish button on the right side. This button would … Read more
There’s really not a ton of great hooks for this one. It uses the WP_Users_List_Table class and the views_users hook, which you could use to parse and replace the number. The hook gives us an array of links like so (even though it’s a flat array, the value is an link). Array ( [all] => … Read more
Start by creating a stylesheet for your plugin.Then you can use the do_action(‘admin_enqueue_scripts’) to enqueue it in the controlpanel only, avoiding it to be loaded in the frontend. You could do something like this: function my_plugin_admin_styles() { wp_enqueue_style(‘my-plugin-admin-style’, plugin_dir_url(__FILE__) . ‘assets/css/admin-style.css’, array(), ‘1.0.0’, ‘all’); } add_action(‘admin_enqueue_scripts’, ‘my_plugin_admin_styles’); Just make sure to correct the path for … Read more
Problem Solved but solution not reusable. I’d like some advice or a solution to assign the same meta_key to each datetime generated. Based from this answer : to assign variables to each datetime from foreach loop I do that (but I think it’s a bad idea to change the name of the array keys using … Read more
It doesn’t make a lot of sense, to me, to say “these should not be used directly by plugins”. I tend to think you should use an available function over the constant – if an available function exists – which, in your case, does not. I would go ahead and use the WP_PLUGIN_DIR constant.