How to add a “data-” attribute to the image tag of native gallery output

Depending on how your Galleria plugin is interacting with the attachment image filters, you should be able to inject your data attribute using the wp_get_attachment_image_attributes filter. Obviously, the attribute would be added for anything using wp_get_attachment_image(), but it will do what you’re asking. /** * Filter attributes for the current gallery image tag. * * … Read more

Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?

I’d figure, it mainly is not advised, because it is intended just to use it for built-in post types, just because you can use for custom post types it does not change anything on that intention. For example, if you use it and there are changes in WordPress that make that arguments use strictly available … Read more

How to retain HTML5 Attributes on Markup

It is enough to add unfiltered_html capability to Editor role. Add the following code into your current theme’s functions.php: function wpse_change_capability() { $role = get_role( ‘editor’ ); if ( ! $role->has_cap( ‘unfiltered_html’ ) ) $role->add_cap( ‘unfiltered_html’ ); } add_action( ‘init’, ‘wpse_change_capability’, 10 ); Login as the user with Editor role. Test it by editing any … Read more

TinyMCE default link target to “_blank”

I was able to achieve this by replacing the wplink plugin with tinyMCE’s default link plugin, and then using the original function as is. I created my own plugin though for the whole tinyMCE editor, and then copy/pasted the individual plugin folders from wp-includes/js/tinymce/plugins, and then only included the ‘link’ plugin, so what I wound … Read more

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