Calling a shortcode in the backend

As you noticed, the plugin use an instance of the class TablePress_Frontend_Controller to render the shortcode. This instance is created by only on frontend requests, this is the reason why shortcode doesn’t work on backend. The function tablepress_print_table function use the TablePress_Frontend_Controller::shortcode_table method to render the table, and this is the reason why also that … Read more

sql query in shortcode not working

I have worked it out and here are the steps to what I did to get it working created a custom table in the wordpress database (called it wp-products) this table had the following fields: id, make, model, price Created a shortcode to retrieve the price. Shortcode looks like this [product_price id=2] where id=2 is … Read more

Passing attributes to shortcode dynamically

Not quite like that, but you can achieve the same result if you use a pre-defined value or argument in your shortcode to act as a “flag”: [authoorsposts author=”post”] …then in your handler: function wpse_209684_author( $atts ) { if ( ! empty( $atts[‘author’] ) ) { $author = $atts[‘author’]; if ( $author === ‘post’ ) … Read more

Simple contact form with field validation

You don’t have any validation mechanism. Your logic should be somewhat along those lines Submit form Check submitted fields ($_POST) against expected values If all looks good send If something is not as expected, log error ( you can use WP_Error() ) and rebuild form showing error message (and maybe repopulating fields with previous “good” … Read more

How to add Shortcode (font awesome) in widget title?

I checked your code in my install. It works, except that you made a typo (missing backslash): [icon]cog[/icon] Few notes: You must make sure to enqueue the Font Awsesome stylesheet. You must close the shortcode, like: [icon]cog[/icon] Remember to escape the class name with esc_attr(). Another shortcode idea: [fa icon=”cog”]

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