Post custom metabox textarea using wp_editor

There is at least 1 issue with using wp_editor in a meta box, as discussed in ticket #19173(Good read on the subject of wp_editor and meta boxes). TinyMCE gets all messed up if you move the meta box that contains it (specifically, if TinyMCE’s location in the DOM is changed). You can, however, use the … Read more

Using TinyMce with textareas in meta boxes on custom post types

Here’s a pastebin with your code included. Get the old value of the tinyMCE $meta_biography = get_post_meta( $post->ID, ‘meta_biography’, true ); Call the TinyMCE Editor wp_editor( $meta_biography, ‘biography’, array( ‘wpautop’ => true, ‘media_buttons’ => false, ‘textarea_name’ => ‘meta_biography’, ‘textarea_rows’ => 10, ‘teeny’ => true ) ); Save The Editor Value or if nothing is there … Read more

Multiple Custom Metabox Help

Solve a complex Problem (rationally) To solve complex problems, there is a kind of standardized/well known approach: Divide your complex problem into a set of smaller problems. Smaller problems are easier to solve. If you have solved each smaller problem you most often have solved your complex problem already. Locate and Divide into Parts So … Read more

Sample code for validating custom metabox?

Straight from the WP Codex @ http://codex.wordpress.org/Function_Reference/add_meta_box, you call the save_post hook and specify the function that will be run to validate/save your data: /* Do something with the data entered */ add_action(‘save_post’, ‘myplugin_save_postdata’); Then you define that function, which will automatically be passed the post id. Additionally, you can access the $_POST array to … Read more

Gutenberg add a custom metabox to default blocks

Using filters we can modify the props and attributes of blocks. First we extend the attributes to include the new attribute: const { addFilter } = wp.hooks; // Register/add the new attribute. const addExtraAttribute = props => { const attributes = { …props.attributes, extra_attribute: { type: “string”, default: “default_value” } }; return { …props, attributes … Read more

How Does WordPress Remember Metabox Positions?

WordPress saves them in the databas in wp_usermeta as serilized array. For the dashboard all are registered in meta-box-order_dashboard if the meta-box(s) are in metaboxhidden_dashboard they will not be shown. The order will be as saved in database and if not in metaboxhidden_dashboard. Example the dashboard: KEY: meta-box-order_dashboard VALUE: Array ( [normal] => dashboard_right_now,dashboard_recent_comments,dashboard_incoming_links,dashboard_plugins [side] … Read more

How to add tab which is visible only in admin side of product in woocommerce? [closed]

I have worked on your issue and found a solution after some Google. Note: Add the below mentioned code to theme’s functions.php or any plugin’s file. Code: This filter function will add a custom tab to the Products Data metabox <?php add_filter( ‘woocommerce_product_data_tabs’, ‘add_my_custom_product_data_tab’ , 99 , 1 ); function add_my_custom_product_data_tab( $product_data_tabs ) { $product_data_tabs[‘my-custom-tab’] … Read more

Creating a metabox to upload multiple images

That depends entirely on what you mean by “attach.” Each WordPress post can already have multiple media attachments – photos, documents, etc. You upload these using the built-in uploader and they’ll all be marked as “attached” to that specific post ID. You can refer to these later programatically elsewhere. For example, the following code will … Read more

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