New answers tagged

0 votes
Accepted

When are Shortcode Attributes Available in Template

The answer from @SallyCJ got me started on the solution that worked best for me. It uses some of her code. There are references to other resources that helped out. function my_get_shortcode_atts($...
user avatar
1 vote

When are Shortcode Attributes Available in Template

I need access to the shortcode attributes before the content (and it's shortcode) is processed.... in the first "is $atts available here" after the add_shortcode In that case, you can ...
user avatar
  • 32.1k
0 votes

Get page id by template

You can query the postmeta table directly: global $wpdb; $template = 'page-special'; $sql = "select post_id from {$wpdb->postmeta} where meta_key = '{$template}.php'"; $pages = $wpdb->...
user avatar

Top 50 recent answers are included