FontAwesome Shortcode isn’t working properly

I tested your code, and it worked for me. Is it possible that your server doesn’t support the extract function? Using extract is frowned upon in PHP now. This is the recommended way of extracting shortcode attributes: function addscFontAwesome($atts) { $args = shortcode_atts( array( ‘type’ => ”, ‘size’ => ”, ‘rotate’ => ”, ‘flip’ => … Read more

Metabox Keeps Stripping Parts of Shortcode

I really should get some sleep 😛 The shortcode is [masterslider] and I manually wrote [metaslider].. That meta box must’ve gotten into my mind.. Just change the appropriate line to this: value=”<?php echo esc_html($value); ?>”> and it works. Thanks @Howdy_McGee for pointing me to the right direction! Also @s_ha_dum for additional knowledge.

Shortcode arguments to another shortcode

You could pass the variable via a global but it would be neater to trap it in a static variable: function track_acc_id($new_id = false) { static $id; if (!empty($new_id)) { $id = $new_id; } return $id; } //This is the accordion container function accordionGroup( $atts, $content = null ) { extract(shortcode_atts(array( ‘id_container’ => ”, ), … Read more

AJAX and do_shortcode

Ajax runs without a main WP_Query object and therefor all its APIs that are used to determine the type of page that is being displayed. The code which is responsible for outputting the result of the shortcode is probably checking for is_single() to be true so it will not add output to archive pages. What … Read more

Create a function to display HTML/data based on site admins role?

I think below line of code is unnecessary, which is wrong if you looking for logged in user result. if( ! is_user_logged_in() ) Please use below code, I make some changes for solution. //Add a hook for a shortcode ‘add_my_form’ tag… add_shortcode( ‘add_my_form’, ‘get_form_on_role’ ); //Create sortcode API used function… function get_form_on_role() { if(is_user_logged_in() ) … Read more

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