Tag Info

Hot answers tagged

3

do_shortcodes_in_html_tags() runs attributes through wp_kses_one_attr() which checks them against wp_kses_allowed_html( 'post' ) which by default only accepts standard non-data attributes, so you'd have to add your attribute: add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) { if ( $context == 'post' ) { ...


2

On the page it shows as [vfb id=’1′] But, when I view source code, it shows as [vfb id=’1′] Look again at the code on the actual page - one mark is a right single quotation mark (8217) and the other character is called a 'prime' (8242). Try removing the punctuation marks so it's just [vfb id=1] (best to use 'Text' view in editor ...


2

NEVER EVER alter any template or file in a theme or plugin that you did not author, and this goes for any core file as well. There is no way to protect the code that you alter or add in any of those files, except maybe changing file permissions, but then again, you will run into other issues ALL customizations should and must be made in either a child theme ...


1

In the Loop, it would be: $authorname = get_the_author_meta('user_nicename'); Or: $authorname = get_the_author_meta('displayname'); Or: $authorname = get_the_author_meta('nickname'); Or any field that get_the_author_meta() accepts. $authorname = get_the_author_meta('user_nicename',123); If you just need to echo the name just use the_author_meta() ...


1

Your have two major issues here The string you are building is correct, but it gets overriden on each iteration of the loop, which at the end will only hold the info from the last post. You need to define your variable outside the loop and then concatenate your info to that variable across the entire loop in order for you to display all postdata from all ...


1

to have the good path to the file, try this : $array = file(plugin_dir_path(__FILE__) . "quotes.txt");


1

Building on the accepted answer and filling in some details... You need to call wp_localize script right after wp_enqueue_script. So, something like this: function my_enqueue_scripts() { wp_enqueue_script( 'myjs', plugins_url( 'js/my.js', __FILE__) ); $options = get_option( 'my_settings' ); $scriptData = array( ...



Only top voted, non community-wiki answers of a minimum length are eligible