How set defaults on wpLink()

Also an small example for change the url in link-button to use the url from installed blog. Use print JS in footer, not an include from js file via wp_enqueue_script() – ist faster vor development, specially for this small requirement, but not so on standard and fine, how the example from the other answer. <?php … Read more

How to order by post meta name in wp admin?

I assume merchant name is another meta field and not the title for that post type? If so, here is a way to organize your admin edit.php area // Add a column in admin edit.php to display the Merchant post type data you want shown add_filter(‘manage_merchant_posts_columns’, ‘admin_merchant_columns’); function admin_merchant_columns( $posts_columns ) { $posts_columns = array( … Read more

Sort admin menu items

It can be done sorting the global $submenu. The sorting that’s applied resets the key number of the sub-array $submenu[‘options-general.php’], which is: array ‘options-general.php’ => array 10 => array 0 => string ‘General’ 1 => string ‘manage_options’ 2 => string ‘options-general.php’ 15 => array 0 => string ‘Writing’ 1 => string ‘manage_options’ 2 => string … Read more

wordpress wp-admin css not loading

I had the same issue a few months back I tried this and this works for me. define(‘FORCE_SSL_LOGIN’, false); define(‘FORCE_SSL_ADMIN’, false); define( ‘CONCATENATE_SCRIPTS’, false ); define( ‘SCRIPT_DEBUG’, true ); try to load wp-admin with SSL. After reloading it looks OK, maybe after re-login, set SCRIPT_DEBUG to false. hope this help

Taxonomy dropdown metabox in the back-end

Here is an example. I have also created a Gist with more generic code. add_action(‘add_meta_boxes’, ‘my_custom_metabox’); function my_custom_metabox() { add_meta_box(‘custom-taxonomy-dropdown’,’Brands’,’taxonomy_dropdowns_box’,’post’,’side’,’high’); } function taxonomy_dropdowns_box( $post ) { wp_nonce_field(‘custom-dropdown’, ‘dropdown-nonce’); $terms = get_terms( ‘brands’, ‘hide_empty=0’); $object_terms = wp_get_object_terms( $post->ID, ‘brands’, array(‘fields’=>’ids’)); // you can move the below java script to admin_head ?> <script type=”text/javascript”> jQuery(document).ready(function() { jQuery(‘#custombrandoptions’).change(function() … Read more

How to remove the core embed blocks in WordPress 5.6?

With WordPress 5.6 (Gutenberg v8.8.0), the implementation of the core-embed/* blocks changed (see pull request #24090: Refactor embed block to single block with block variations). There are now 43 blocks with block variations of the core/embed block. Available core blocks are: core/paragraph core/image core/heading core/gallery core/list core/quote core/shortcode core/archives core/audio core/button core/buttons core/calendar core/categories core/code … Read more