How to enable the tag in WordPress posts and pages

First things first, modifying core files is extremely frowned upon you will have to make these changes with every upgrade and they can lead to security and other problems. I’m pretty sure there is a plugin that will allow this. I did a simple search and here are a few to try: http://wordpress.org/extend/plugins/preserved-html-editor-markup/ http://wordpress.org/extend/plugins/ultimate-tinymce/

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

How to group meta boxes on the post edit page

Thanks for the hint Bainternet, indeed this is very easy to implement with jQuery. Example (the four meta boxes are closed for clarity) : Here’s what I did : var $j = jQuery.noConflict(); $j(document).ready(function() { $j(“#side-sortables”).append(‘<div id=”container_div” class=”postbox meta-box-sortables ui-sortable”><div class=”handlediv” title=”Click to toggle.”><br></div><h3 class=”hndle”><span>Container Meta Box</span></h3><div id=”container_inside” class=”inside”></div></div>’); $j(“#my_metabox_div”).appendTo(“#container_inside”); $j(“#my_other_metabox_div”).appendTo(“#container_inside”); etc… }); I added … 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

WordPress 4.6 link edit dialog is too rudimentary

To disable the inline link tool and revert it back to a pop-up screen instead, do the following: In your child theme directory, add the following to your function.php: add_filter( ‘mce_external_plugins’, ‘wpse_236590_link_editor’ ); function wpse_236590_link_editor( $plugins ) { $plugins[‘full_link_dialog’] = plugins_url( ‘js/’, __FILE__ ) . ‘editor.js’; return $plugins; } Next create a directory inside your … Read more

Post/Page Publish/Update button not clickable once I make an edit

It appears to be a bug, but one that can be hacked around each time it happens with about 2 seconds of work. This wordpress forum thread: If you’re using Chrome, right-click on the greyed-out “Update” button and select “Inspect Element”. You will see something to the likes of: <input name=”save” type=”submit” class=”button button-primary button-large … Read more

How to make a script load after Custom Block is loaded in the editor?

I couldn’t find a built in ACF way of doing this. Instead, in my block’s PHP render function I added printf( “<script>window.jQuery(window).trigger(‘acf/loaded/block-name’);</script>” ); This uses jQuery as an event bus to trigger an event when the block is rendered. You might need to include a check that you’re in the admin so the event won’t … Read more

Prevent WordPress from abbreviating-long-slugs…-in-the-admin

There is a filter at the end of the function: ‘get_sample_permalink_html’. Hook into this and just replace the shortened form with the full length. <?php # -*- coding: utf-8 -*- /* Plugin Name: T5 Unabridge Permalink Slug */ add_filter( ‘get_sample_permalink_html’, ‘t5_unabridge_sample_permalink’, 10, 2 ); /** * Replaces the shortened permalink with its full form. * … Read more

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