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

Adding a custom field to the site identity menu

You’ll have to add your own customizer controls to achieve that. So for example, if you want to add Company Name, you can use this code: function my_register_additional_customizer_settings( $wp_customize ) { $wp_customize->add_setting( ‘my_company_name’, array( ‘default’ => ”, ‘type’ => ‘option’, // you can also use ‘theme_mod’ ‘capability’ => ‘edit_theme_options’ ), ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, … Read more

SQL Query to copy value of a meta_key into another meta_key

First take a db backup! Second, in your question you mention the same meta_key, so made the following assumption: The meta_key you want to keep is “ehp_citation” The meta_key you want to change is “ehp_citation_old” * so make the correction accordingly Then you can try something like: UPDATE `wp_postmeta` AS pm_to_change LEFT JOIN `wp_postmeta` AS … 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

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