When I install the plugin, I want to create 10 CPTs of a particular type, which I define in the init action hook, and want to assign 10 terms...
I have a multi-author blog, on which there are two schedule cron functions. The first function moves all public posts in the pending status after 365 days: if( !...
I’m using register_block_type to register my blocks. I’m not sure what is the best hook to use, between init and enqueue_block_editor_assets. I suppose that enqueue_block_editor_assets it is loaded after,...
I want to intercept requests to public files in WordPress, more specifically all requests to any file located in /wp-content/uploads. Using request or even init filters didn’t help, e.g....
I`m trying to retrieve the names of taxonomy items and include them into a theme admin panel. function retrieve_my_terms() { global $terms; $terms = get_terms('taxonomy'); foreach ($terms as $term)...
I’m hoping someone can point me in the right direction here. I’m using the WordPress Plugin Boilerplate to develop a custom plugin. On install, the plugin will register a...
I am trying to redirect the user after form submission using wp_redirect() but it it is not working. I am submitting data using init action hook. here is the...
There seems to be quite a controversial opinion on the WordPress flush_rewrite_rules() function. According to the Codex, it is highly discouraged to use this function on the init action...
Is possible to change page title on the fly from plugin? I’ve try global $post, but seem like plugin runs after. Any Ideas? Edit: Im writting some pages on...
When you use the register post type and register taxonomy functions in your functions.php, where do all that setting info get stored in regards to the CT’s and CPT’s...