Skip to content

Instantly share code, notes, and snippets.

View itsHall's full-sized avatar
💭
Living

Tyler Hall itsHall

💭
Living
View GitHub Profile
@itsHall
itsHall / wp-remove-yoast.php
Last active October 7, 2021 14:03 — forked from omniacode/wp-remove-yoast.php
Remove Yoast Metabox for Everyone Except Admins
<?php
// Removes the Yoast Metabox for Roles other then Admins
// Returns true if user has specific role
function check_user_role( $role, $user_id = null ) {
if ( is_numeric( $user_id ) )
$user = get_userdata( $user_id );
else
$user = wp_get_current_user();
if ( empty( $user ) )
return false;
@itsHall
itsHall / cleanup-wpml-translations.txt
Last active January 5, 2021 15:19 — forked from vanpariyar/gist:3112c09a9582cc9c356c32adb6ffa5e9
[Solved] Fatal error: Uncaught TypeError: Argument 1 passed to WPML_Media_Post_Images_Translation::translate_images_in_post_content()
Fatal error: Uncaught TypeError: Argument 1 passed to WPML_Media_Post_Images_Translation::translate_images_in_post_content() must be an instance of WP_Post, null given, called in /www/htdocs/w0184db4/helmut-kostner.it/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 107 and defined in /www/htdocs/w0184db4/helmut-kostner.it/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php:130 Stack trace: #0 /www/htdocs/w0184db4/helmut-kostner.it/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php(107): WPML_Media_Post_Images_Translation->translate_images_in_post_content(NULL, Object(WPML_Post_Element)) #1 /www/htdocs/w0184db4/helmut-kostner.it/wp-includes/class-wp-hook.php(288): WPML_Media_Post_Images_Translation->translate_images(5) #2 /www/htdocs/w0184db4/helmut-kostner.it/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters