there's a problem, I can not understand what I'm doing wrong ..
I want to get the value of the function of the other features in WordPress ..
This code replaces some parts of the code ..
I want to get the value of the argument variable words (it needs to go $attr['words']) and then use the other functions (new_quote).
<?php
/*
* Plugin Name: Random Quotes
*/
function random_quote($atts) {
extract( shortcode_atts( array(
'path' => plugin_dir_path(__FILE__).'quotes.txt',// default, if not set
'label_new' => 'New Quote',
'words' => 'no' // yes or no
), $atts ) );
$temp = $attr['words']; // no
...
}
add_shortcode('randomquotes','random_quote');
function new_quote(){
global $temp; // NULL
/*
global $attr;
$temp = $attr['words']; // again NULL
*/
...
if($temp == "no") {
...
}
}
...
?>
What am I doing wrong? Maybe just can not get the value of this variable?
new_quote()function? And why do you need it?