This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| If you see this message when you run composer command: | |
| do not match its signature. This should indicate a man-in-the-middle attack. Try running composer again and report this if you think it is a mistake. | |
| From the command line run: | |
| composer config --global repo.packagist composer https://packagist.org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'phpmailer_init', 'replace_to_embedded' ); | |
| function replace_to_embedded( $phpmailer ) { | |
| $content = replace_img_src( $phpmailer->Body ); | |
| foreach ( $content['images'] as $image_url ) { | |
| $path = parse_url( $image_url, PHP_URL_PATH ); | |
| $image_path = ABSPATH . $path; | |
| $phpmailer->AddEmbeddedImage( $image_path, basename( $image_url ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Remove Pass enforce | |
| Version: 1.0 | |
| Author: Yehuda Hassine | |
| License: GPL2 | |
| */ | |
| add_action('login_enqueue_scripts', 'remove_pass_enforce', 11 ); | |
| function remove_pass_enforce() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Dynamic Facebook og image | |
| Description: Allow you to choose an image for facebook og. | |
| Author: Yehuda Hassine | |
| Version: 1.0 | |
| */ | |
| add_action('add_meta_boxes', 'fb_og_image_mb'); | |
| function fb_og_image_mb() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Get field key for field name. | |
| * Will return first matched acf field key for a give field name. | |
| * | |
| * ACF somehow requires a field key, where a sane developer would prefer a human readable field name. | |
| * http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name | |
| * | |
| * This function will return the field_key of a certain field. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| global $pagenow; | |
| if ( isset( $_GET['lang'] ) && is_admin() && $pagenow != 'post.php' ) { | |
| $user_id = wp_get_current_user()->ID; | |
| $lang = filter_var( $_GET['lang'], FILTER_SANITIZE_STRING ); | |
| update_user_meta( $user_id,'icl_admin_language', $lang ); | |
| $url = "http" . (($_SERVER['SERVER_PORT'] == 443) ? "s://" : "://") . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
| $redirect = esc_url( remove_query_arg( 'lang', $url ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get_main_image( $image_url, $post_id ) { | |
| $upload_dir = wp_upload_dir(); // Set upload folder | |
| $image_data = file_get_contents($image_url); // Get image data | |
| $filename = basename($image_url); // Create image file name | |
| // Check folder permission and define file location | |
| if( wp_mkdir_p( $upload_dir['path'] ) ) { | |
| $file = $upload_dir['path'] . '/' . $filename; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add the field to order emails | |
| **/ | |
| add_filter('woocommerce_email_order_meta_keys', 'my_custom_checkout_field_order_meta_keys'); | |
| function my_custom_checkout_field_order_meta_keys( $keys ) { | |
| $keys[‘My Field 1′] = ‘_my_field_1; | |
| $keys[‘My Field 2′] = ‘_my_field_2′; | |
| return $keys; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dialog = $( "#dialog-form" ).dialog({ | |
| autoOpen: true, | |
| height: 300, | |
| width: 450, | |
| modal: true, | |
| open: function () { | |
| if ($.ui && $.ui.dialog && $.ui.dialog.prototype._allowInteraction) { | |
| var ui_dialog_interaction = $.ui.dialog.prototype._allowInteraction; | |
| $.ui.dialog.prototype._allowInteraction = function(e) { | |
| if ($(e.target).closest('.select2-dropdown').length) return true; |
NewerOlder