update_option is not working!

I was able to get this working by using a separate option, that is not an array. I hate having to use multiple options like this but it works so I am going to go with it. My guess is that using update_option is not supported after implement the option with the settings API.

Calling a function from functions.php in custom page/ blog post

You could use add_shortcode if you want to use it within the editor. function footag_func() { return “Test”; } add_shortcode( ‘footag’, ‘footag_func’ ); And then use [footag] in your editor. Or Use code like this in functions.php and add a conditional tag add_action( ‘loop_start’, ‘your_function’ ); function your_function() { if ( is_singular(‘post’) ) { echo … Read more

WordPress Media mime type filter problem 4.0

Here’s a workaround you can put in a plugin or your theme’s functions.php file. So far no problems. /* * Workaround Bug 30123 * Affects WP 4.0+, should be fixed in WP 4.1 * https://core.trac.wordpress.org/ticket/30123 */ function bugfix30123__action__admin_init() { if ( isset( $_GET[‘attachment-filter’] ) && is_string( $_GET[‘attachment-filter’] ) ) { $_GET[‘attachment-filter’] = $_REQUEST[‘attachment-filter’] = str_replace( … Read more

How to bundle a plugin with a theme, or vice versa

You can use some of the following functions to build your own “theme plugins” registration: is_plugin_active( $plugin ); is_plugin_active_for_network( $plugin ); is_plugin_inactive( $plugin ); get_plugins( $plugin_folder ); // register your own theme-plugins folder? get_plugin_data( $plugin_file ); I use “theme plugins” myself. But not in the manner of: I have dozens of “real” plugins and then … Read more

Load WooCommerce templates from my plugin folder first

I think you can use template redirect action. I don’t test it but it should work: function my_template_redirect(){ //pages you want to make true, ex. is_shop() if(is_shop()) { $plugin_dir = WP_PLUGIN_DIR.”https://wordpress.stackexchange.com/”.str_replace( basename( __FILE__), “”, plugin_basename(__FILE__) ); load_template($plugin_dir . ‘your-template.php’); } } add_action(‘template_redirect’,’my_template_redirect’);

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