Hot answers tagged

2

You can't. Not how you've written it. You need to be able to access the instance of ChildAdminClass somehow, but it only exists within the MainAdminClass class and isn't exposed in any way. In your code attempting to remove it you've referenced $child_admin as a global variable, but you didn't create it as a global variable. If you did this: public function ...


1

I think for your purpose wp_untrash_post_status filter will be enough. Will work with single and multiple posts restore. Filters the status that a post gets assigned when it is restored from the trash (untrashed). add_filter( 'wp_untrash_post_status', 'change_untrash_post_status'); function change_untrash_post_status($status){ return 'pending'; } P.S....


1

Used shorcodes can be retrived only if they are added in post content (or any content saved in db). They can not be retrived if hardcoded in template files (TBH, they can, but that's not the issue here). This code can help you to get the shortcodes used in a post content. function wpse387291_get_shortcodes() { global $post; $pattern = ...


Only top voted, non community-wiki answers of a minimum length are eligible