Adding Third Post Box Column: postbox-container-3
Adding Third Post Box Column: postbox-container-3
Adding Third Post Box Column: postbox-container-3
You need something like the following: $metabox_array = array (array(‘view1’, ‘Metabox for View 1’, ‘Render View 1’, ‘Post’, ‘normal’, ‘default’, ‘view2’, ‘Metabox for View 2’, ‘Render View 2’, ‘Post’, ‘normal’, ‘default’, ‘view_x’, ‘Metabox for View_x’, ‘Render View_x’, ‘Post’, ‘normal’, ‘default’,)); function adding_custom_meta_boxes( $post ) { add_meta_box($metabox_array); } add_action( ‘add_meta_boxes_post’, ‘adding_custom_meta_boxes’ ); As kiaser states though, … Read more
You’re not using wordpress default ajax mechanism. To do that: jQuery.ajax({ type: “POST”, url: “/wp-admin/admin-ajax.php”, // Send request to admin-ajax.php data: newcontact, // Can be anything. As per your need action: ‘myaction’, // Required to send otherwise WordPress AJAX won’t authorize your request. success: function(data) { jQuery(“.follow-user”).html(data); } }); AJAX Request Handler add_action( ‘wp_ajax_myaction’, ‘so_wp_ajax_function’ … Read more
I’ve managed to solve this using Javascript to ‘open’ the menu item when on the edit tags page in the plugin. Relevant plugin PHP file $screen = get_current_screen(); // Check we’re only on the edit-tags page in the plugin if (‘edit-tags’ === $screen->base && ‘subscriber’ === $screen->post_type) { wp_enqueue_script( $this->plugin_slug . ‘-subscriber-edit-tags-script’, plugins_url(‘assets/js/subscriber-edit-tags.js’, __FILE__ ), … Read more
You appear to be quite close to having this all sorted out. If you wrap your queries in a function, and separate the logic and presentation: <?php function wpse_158425_get_terms(){ global $wpdb, $rpt_options; $wpdb->show_errors(); $rpt_days = $rpt_options[‘number_days’]; $rpt_term_ids = $wpdb->get_col(” SELECT term_id FROM $wpdb->term_taxonomy INNER JOIN $wpdb->term_relationships ON $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id INNER JOIN $wpdb->posts ON $wpdb->posts.ID … Read more
Custom query not working in plugin admin page
it’s a little difficult to debug something when no errors are being displayed. i’d first check your php error logs, which normally appear in ….\logs\php_error.log or ….\logs\apache_erroe.log depending on your php.ini settings. chances of getting an immediate answer to your question will be difficult unless you can provide the actual error that’s popping up.
So I found out the problem was in the database. If I deleted the page, then re-created it then it functioned as it should. I couldn’t narrow down what exactly was wrong with the data, but something was. That page did have a lot of revisions, not that it should matter?
I think similar question is answered here: Send user activation email when programmatically creating user Please have a look. Let me know if that solves the issue.
Please check the callback function name for example add_action( ‘woocommerce_process_product_meta’, ‘new_metabox_save’,35 ); Function definiton function new_metabox_save(){ $post = get_post( $post_id ); }