Custom “Publish” / “Update” button &

You can stimulate click to Update post button like this.. Adding submit or update button to custom metabox? <script> jQuery(‘.metabox_submit’).click(function(e) { e.preventDefault(); jQuery(‘#publish’).click(); }); </script> <input type=”submit” class=”metabox_submit” value=”Submit” />

Metabox cloning via Admin Ajax call issue

1st This isn’t a WP problem, but a jQuery problem. 2nd I used to develop my own set of classes for meta box and stopped about a month a ago and dropped them in favor of the RW Meta Box library. Meta Boxes are a big issue incl. saving the data, building an endless # … Read more

Only show metabox when date-value in other metabox is over?

Not sure about the linked class – it seems they collect metaboxes immediately and so there is no information regarding what post is being viewed. In general though – yes it is possible. To add a metabox: add_action( ‘add_meta_boxes’, ‘myplugin_add_my_custom_box’,10,2); See the source code here. This add_meta_boxes hook passes two variables: the post type and … Read more

How to Make a Categories Meta Box with Hierarchical Checkboxes on Frontend?

Try wp_terms_checklist() / wp_category_checklist. It will output a list of checkboxes named post_category. You might need to include the source file too, because it’s defined within administration files. Or use a custom walker: class MyCategoryWalker extends Walker_Category{ public function start_el(&$output, $term, $depth, $args){ $args = wp_parse_args(array( ‘name’ => ‘my_category_input’, ‘checked’ => array(), ), $args); extract($args); … Read more

Use meta box value in CPT as post title

<?php add_action( ‘save_post’, ‘post_updated’ ); function post_updated( $post_id ) { // verify post is not a revision & not an autosave if ( !wp_is_post_revision( $post_id ) && !(defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE) ) { // set the new post title $post[‘ID’] = $post_id; $post[‘post_title’] = get_post_meta($post_id, ‘ecpt_name’, true); // update the post, removing the action … Read more

How to limit the pages displayed for choosing parent page on page attribute’s menu?

This meta box is printed with page_attributes_meta_box and the select field for choosing parent is generated with this code: if ( is_post_type_hierarchical( $post->post_type ) ) : $dropdown_args = array( ‘post_type’ => $post->post_type, ‘exclude_tree’ => $post->ID, ‘selected’ => $post->post_parent, ‘name’ => ‘parent_id’, ‘show_option_none’ => __(‘(no parent)’), ‘sort_column’ => ‘menu_order, post_title’, ‘echo’ => 0, ); $dropdown_args = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)