Second transition_post_status hook fired instead of the first

You can user if..else condition to combine both function into one hook. add_action( ‘transition_post_status’, ‘groupqueue_to_groupcpt_and_groupcpt_to_bannedcpt’, 10, 3); function groupqueue_to_groupcpt_and_groupcpt_to_bannedcpt($new_status, $old_status, $post){ //Move to Group Post Type if (‘publish’ === $new_status && ‘groupq’ === $post->post_type ) { wp_update_post(array( ‘ID’ => $post->ID, ‘post_type’ => ‘group’ ), true ); } else if ( ‘banned’ === $new_status && (‘groupq’ … Read more

Image upload and download from front-end

I am working on this code for the front of an ERP application. Note that only after uploading will it be possible to insert the message. You will need to click edit to open the modal and enter the content. Maybe it’s useful for you! Insert in your functions.php <?php if(!is_admin()){ if(!function_exists(‘ajax_upload_files’)): function ajax_upload_files(){ wp_enqueue_script(‘ajax-upload-files’, … Read more

Most efficient way to use classes to create admin pages using Settings API

The example in Settings API documentation uses admin_init and admin_menu for registering custom settings and admin pages. https://developer.wordpress.org/plugins/settings/custom-settings-page/ There’s also an old Codex entry on actions typically run on front and back end requests, which can help pick a suitable action hook. https://codex.wordpress.org/Plugin_API/Action_Reference I also highly recommend the excellent old Q&A about instantiating classes in … Read more

Fatal error: Uncaught Error: Call to undefined function test()

Not sure what your test() function is meant to achieve, or if you’ve even defined it, but yes if you haven’t defined it then it’s undefined. In reference to your question: “What’s the best method to include all content from profile-card.php and use that shortcode to show it?” The answer is actually in your question, … Read more