How do I disable wpautop for a specific block?

@morgan-estes Great solution but it i think it should be better to add_filter in else so the next block or content gets filter with WPAUTOP /** * Try to disable wpautop inside specific blocks. * * @link https://wordpress.stackexchange.com/q/321662/26317 * * @param string $block_content The HTML generated for the block. * @param array $block The block. … Read more

How to add “Check all” to Edit post page in WP?

try this- remove_meta_box(‘categorydiv’); add_meta_box(‘categorydiv’, “Categories”, ‘mycustom_category_meta_box’, null, ‘side’, ‘core’, array( ‘taxonomy’ => ‘category’ )); function mycustom_category_meta_box($post, $box) { $defaults = array(‘taxonomy’ => ‘category’); if ( !isset($box[‘args’]) || !is_array($box[‘args’]) ) $args = array(); else $args = $box[‘args’]; extract( wp_parse_args($args, $defaults), EXTR_SKIP ); $tax = get_taxonomy($taxonomy); ?> <div id=”taxonomy-<?php echo $taxonomy; ?>” class=”categorydiv”> <ul id=”<?php echo $taxonomy; … Read more

WordPress Post Editor Toolbar Missing

Make sure in your user Profile you have Visual Editor un-checked. Sometimes when migrating WordPress sites you may lose widget placement for some reason. I would also un-install and re-install any plugins. But moving from one host to another host when your domain URL has not changed is usually easy going. Can you take a … Read more

can’t see all pages in dashboard (can only see 3) /wp-admin/edit.php > 500 error

Please open your wp-config.php file and change the parameter like this: define(‘WP_DEBUG’, true); Once this parameter is activated, you can see more details about the error. Try to activate any default WordPress theme like TwentySeventeen and look if the error still exists. Update: function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id) { if(empty($custom_fields)) { $custom_fields = array( ‘slideshow’ => array( … Read more

How to replace default icon on “Add Media” button?

CSS is the way to go here. Add a new CSS for admin using the admin_enqueue_scripts hook in your child theme functions.php (if you don’t have one, you’re doing something wrong) function my_admin_enqueue_style() { wp_enqueue_style(‘my-css’, get_stylesheet_directory_uri().’/css/my-admin.css’, array(), ‘1.0.0’); } add_action(‘admin_enqueue_scripts’, ‘my_admin_enqueue_style’); In your my-admin.css file /* change the content to another Dashicon */ #wp-content-editor-tools .wp-media-buttons … Read more

Disable the visibility options in WP

Quick hack to get the job done, in case anyone else needs to do this: add_action(‘add_meta_boxes’, function() { add_action(‘admin_head’, function() { echo <<<EOS <style type=”text/css”> #visibility { display: none; } </style> EOS; }); }); add_action(‘restrict_manage_posts’, function() { echo <<<EOS <script type=”text/javascript”> jQuery(document).ready(function($) { $(“input[name=”keep_private”]”).parents(“div.inline-edit-group:first”).hide(); }); </script> EOS; }); (Still curious to know if there’s a … Read more

Add custom fields within meta box class “on the fly”

Agreed, I’ve seen it too, but I don’t think there’s any readily available API or method. For me, I use a lick of jQuery; <input type=”text” class=”list-item” name=”list_items[]” /> <input type=”button” class=”button-secondary” id=”add-list” /> <script type=”text/javascript”> ( function( $ ) { $( ‘#add-list’ ).click( function() { var $item = $( ‘.list-item:last’ ), $new = $item.clone(); … Read more

How can I put a custom meta box above the editor but below the title section on the edit post page?

Simply add a meta box using the advanced context, and high priority Then, latch on to the edit_form_after_title hook Print your meta boxes out there, then remove it so it doesn’t appear twice. // Move all “advanced” metaboxes above the default editor add_action(‘edit_form_after_title’, function() { global $post, $wp_meta_boxes; do_meta_boxes(get_current_screen(), ‘advanced’, $post); unset($wp_meta_boxes[get_post_type($post)][‘advanced’]); });