php - How to get access to the variables in Visual Composer extended WordPress plugin? -
i'm trying extend client's page backend visual composer extended plugin. i've been next instructions given here: http://kb.wpbakery.com/index.php?title=visual_composer_tutorial.
the plugin shows @ wp backend , fields have created shown:
array( "type" => "textfield", "holder" => "div", "class" => "", "param_name" => "fourth_quote", "value" => __("", 'vc_extend'), "description" => __('fourth testimonial quote', 'vc_extend') )
however, don't understand how i'm supposed access 'fourth_quote' later on:
public function rendermybartag( $atts, $content = null) { extract( shortcode_atts( array( 'faa' => 'something', 'color' => '#ff0000' ), $atts ) ); $content = wpb_js_remove_wpautop($content, true); // prepare unclosed/unwanted paragraph tags in $content $output = '<div>{$fourth_quote}</div>'; error_log(date('[ d.m.y h:i:s ] ') . $output . php_eol, 3, "my-errors.log"); homecoming $output; }
this, doesn't output there content stored.
how access content user have created @ backend i'd able render page based on that? how variables?
from http://kb.wpbakery.com/index.php?title=visual_composer_tutorial:
this list represents shortcode tag base of operations , params list editable settings form within js_composer constructor.
you must add together fourth_quote
attribute shortcode. example:
public function rendermybartag( $atts, $content = null) { # also, avoid using extract() # http://stackoverflow.com/questions/829407/what-is-so-wrong-with-extract # http://codex.wordpress.org/shortcode_api $a = shortcode_atts( array( 'faa' => 'something', 'color' => '#ff0000', 'fourth_quote' => false, // default value ), $atts ); $content = wpb_js_remove_wpautop($content, true); $output = $a['fourth_quote']; error_log(date('[ d.m.y h:i:s ] ') . $output . php_eol, 3, "my-errors.log"); homecoming $output; }
php wordpress wordpress-plugin backend
No comments:
Post a Comment