Yoast and another plugin

Yoast only looks at the_content – that is, the content in the main, default WP editor. If your other plugin stores the content of posts in any other way, Yoast won’t see that content. You’ll probably be best off just disabling content analysis in Yoast if you’d like to continue using that plugin. Or, you … Read more

Return raw image proxy for wordpress plugin

I circumvented the issue with the following hack of images.php. <?php // Import wordpress API. require_once(‘../../../wp-load.php’); function hinews_get_image($id) { if (array_key_exists(‘mimetype’, $_GET)) { $mimetype = $_GET[‘mimetype’]; } else { return ‘No MIME type specified.’; } $options = get_option(‘homeinfo_news_options’); $parm_token = ‘?access_token=’ . $options[‘token’]; $base_url=”https://myurl.com/”; $image_url = $base_url . $id . $parm_token; $image = file_get_contents($image_url); if … Read more

How to trigger WooCommerce user profile edit change?

Try this below code add_action( ‘personal_options_update’, ‘save_user_profile_update’ ); add_action( ‘edit_user_profile_update’, ‘save_user_profile_update’ ); function save_user_profile_update( $user_id ) { update_user_meta( $user_id, ‘address’, $_POST[‘address’] ); update_user_meta( $user_id, ‘city’, $_POST[‘city’] ); update_user_meta( $user_id, ‘postalcode’, $_POST[‘postalcode’] ); }

OOP development and hooks

Sally CJ raises a good point in their comment that it is probably better to have each class initialize its own actions and filters. I’ve been working with the same boiler plate for some time now and created my own version of this boiler plate on GitHub. In that version I have a Back\Hooks and … Read more