Plugin Author
Ajay
(@ajay)
Would something like this sense to do something like this:
global $crp_settings;
extract( shortcode_atts( array(
'limit' => $crp_settings['limit'],
'heading' => $crp_settings['heading'],
'cache' => $crp_settings['cache'],
), $atts ) );
I think
function crp_shortcode( $atts, $content = null ) {
$atts = shortcode_atts( array(
'is_widget' => 1,
), $atts );
return ald_crp($atts);
}
is enough. Allows every setting to be overridable while letting ald_crp take care of handling defaults and overrides. I haven’t tested this but don’t see why you’d need to specify the rest.
Plugin Author
Ajay
(@ajay)
I’ll give it a try, but from what I see above a user could just put any attribute based on the settings and the plugin should ideally handle this (subject to testing, of course)
Hmm, then perhaps
function crp_shortcode( $atts, $content = null ) {
global $crp_settings;
$atts = shortcode_atts(array_merge(
$crp_settings,
array('is_widget' => 1),
), $atts );
return ald_crp($atts);
}
Plugin Author
Ajay
(@ajay)
Thanks, will give me a test run.
Just checking in to see if there’s been any update on this? I would love it if I could simply type the [crp] shortcode and have it follow the plugin settings regarding limit etc.
I only want 2 posts to show up every time, but have to add [crp limit=”2″] instead of simply [crp] otherwise it ignores the plugin settings and defaults to 5 every time.
Plugin Author
Ajay
(@ajay)
Hi, this will be in the next release of the plugin.
For now, you can give flynsarmy’s code above by editing the plugin.