Two related taxonomies. how to filter terms in second taxonomy depending on selected term in first taxonomy on Post edit page?

My approach would be: Hide city edition metabox, by setting public to false. I would override how metabox for country should render by using meta_box_cb parameter. You should provide callback for the function that will do the render. In this function, you first render the field for country, and then on choose you make an … Read more

Metabox conditionals depending on post format and template in Gutenberg

Better way is to listen to Gutenberg events. Template change can be observed with something like this: wp.data.subscribe(() => { console.log(wp.data.select( ‘core/editor’ ).getEditedPostAttribute(‘template’)); }); It will fire on many wp.data events, not only for template change. But you can add some checks and do your actions only when it’s needed. Example: const editor = wp.data.select( … Read more

How to change the text of Publish Button

You can use the following code to change Publish button’s text to Save even after editing Post Status. Do not forget: Clicking OK or Cancel buttons when editing Post Status will change Publish button’s text. This happens also when editing Post Visibility and Publish time. I used setTimeout() to postpone changing Publish button’s text after … Read more

Saving custom input from settings sidebar of pages in WordPress

You have forgot to add name of the input box so kindly modify your code for meta box creation as below function j_meta_box_cb( $post ) { $value = get_post_meta( $post->ID, ‘j-icon’, true ); ?> <input id=”j-meta-box” type=”text” name=”j-icon”value=”<?php echo esc_attr( $value ) ?>”></input> <?php } Let me know still if you hv any queries.

Only display top level taxonomy on the edit post page with option to expand sub-categories

This is a VERY untested approach, but the recent addition of CSS’s :has selector has been top-of-mind for me lately, and I wondered if a simple solution could be built using purely CSS.. As a proof of concept, add the following to your site’s admin CSS: #categorychecklist > li .children{display:none;} #categorychecklist > li:has(input:checked ) .children{display:block;} … Read more

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