Create custom markup to use in posts?

You are probably looking for The Shortcode API that allows to create shortcodes like [my_shortcode] and [my_shortcode]some text[/my_shortcode] to be used in content and other shortcode-enabled areas. More advanced technique are way more involved and might require storing editable and rendered representation of content separately or do apply custom rendering filter every time content is … Read more

Submitting form in wordpress plugin

Reviewing wp_dropdown_users() there is apparently a ‘selected’ parameter. So in theory, you could probably pass the posted value in here. // set to the posted value, but you might be able to do this differently, depending on how you are storing the data $selected = isset($_POST[‘author’]) ? $_POST[‘author’] : false; $args = array( ‘name’ => … Read more

Strange iframes added in wordpress 4.1 localhost

This is not a WordPress issue. A Google search for boostsaves.com reveals it is a browser add-on that injects iframes into the page source of whatever you’re viewing. Use Google to find instructions on how to remove it from whatever browser you’re using.

Remove tags from wordpress head

I believe a filter on the_generator will do it. add_filter(  ‘the_generator’,  ‘__return_empty_string’, PHP_INT_MAX ); Reference: https://codex.wordpress.org/Function_Reference/_return_empty_string. https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/general-template.php#L2956

Allow HTML in Settings API input field

When you register a setting, you pass the santize callback for that setting: register_setting( ‘my_setting_group’, ‘my_setting_name’, // The next parameter is the validation callback ‘my_setting_validation’ ); Then, in the validation callback you can allow whatever you want. For example, in the next code snippet, users with unfiltered_html capability will be allowed to insert raw HTML … Read more

Using custom HTML tags to WordPress [closed]

[*] You can expand list of KSES allowed tags (and their attributes): add_filter(‘wp_kses_allowed_html’, ‘wpse_283385_blocktip_tag’); function wpse_283385_blocktip_tag($allowed_tags) { $allowed_tags[‘blocktip’] = array( ‘name’ => true, ‘id’ => true, ‘class’ => true, ‘style’ => true ); return $allowed_tags; } add_filter(‘tiny_mce_before_init’, ‘wpse_283385_blocktip_tag_tinymce’); function wpse_283385_blocktip_tag_tinymce($init) { $tags=”blocktip[*]”; if ( isset( $init[‘extended_valid_elements’] ) ) { $init[‘extended_valid_elements’].= ‘,’.$tags; } else { $init[‘extended_valid_elements’] … Read more

Unfamiliar HTML Properties in Avada and Divi Themes [closed]

These are called data attributes, which are custom attributes in the format of data-* used to attach more info to the html elements. This link here gives good examples on how to use them: https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes Example: <div id=’el’ data-my-attr=”attr_value”></div> JavaScript: Most of the time, these info are used by JavaScript to fetch data and process … Read more

Inline style HTML attribute is being stripped from all elements of a post

This is because what you’re trying to do trips a security feature, post content is passed through wp_kses_post to strip out dangerous tags Administrators however, have the unfiltered_html capability, which allows them to put arbitrary dangerous HTML in content and titles. This is why you’re able to insert the tags via the editor. This still … Read more