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 | |
| /* | |
| * To change this template, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| $repos= array(); |
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
| $._data( $("#foo")[0], "events" ); |
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 check_broken_media () { | |
| global $wpdb; | |
| $media_model = new RTMediaModel(); | |
| $ob_migration = new RTMediaMigration(); | |
| $sql = "select * from wp_postmeta m join wp_posts p on p.ID = m.post_id where meta_value like '%rtMedia%'"; | |
| $results = $wpdb->get_results ( $sql ); | |
| $upload_path = trim ( get_option ( 'upload_path' ) ); | |
| if ( empty ( $upload_path ) || 'wp-content/uploads' == $upload_path ) { | |
| $dir = WP_CONTENT_DIR . '/uploads'; |
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( ! function_exists ("bp_latest_update_fix" )){ | |
| function bp_latest_update_fix () { | |
| global $wpdb; | |
| $sql = "select * from $wpdb->usermeta where meta_key like 'bp_latest_update'"; | |
| $results = $wpdb->get_results ( $sql ); | |
| foreach ( $results as $row ) { | |
| if ( $meta_value = maybe_unserialize ( $row->meta_value ) ) { | |
| if ( is_array ( $meta_value ) ) { | |
| if ( isset ( $meta_value[ "content" ] ) && strpos ( $meta_value[ "content" ], "update_txt" ) !== false ) { | |
| $data_up = json_decode ( $meta_value[ "content" ] ); |
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
| //Calculate frame ratio | |
| $frame_ratio = ( float ) $frame_w / ( float ) $frame_h ; | |
| //Calculate image ratio | |
| $image_ratio = ( float ) $image_w / ( float ) $image_h ; | |
| //Checking if both ratio are same | |
| if ( round ( $frame_ratio , 2 ) != round ( $image_ratio , 2 ) ) { |
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
| Moved to https://github.com/xwp/vip-quickstart/pull/3 |
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
| dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge |
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( 'widgets_init', 'nbclatino_top_posts_widget_init' ); | |
| function nbclatino_top_posts_widget_init() { | |
| // Check if our vip stats function is available | |
| if ( !function_exists( 'wpcom_vip_get_stats_array' ) && ! function_exists( 'stats_get_csv' ) ) | |
| return; | |
| unregister_widget( 'Jetpack_Top_Posts_Widget' ); |
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
| WP_PATH="/var/www/site_path" | |
| for SITE_URL in = $(wp site list --fields=domain,path,archived,deleted --format=csv --path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}') | |
| do | |
| echo $SITE_URL | |
| for EVENT_HOOK in $(wp cron event list --format=csv --fields=hook,next_run_relative --url="$SITE_URL" --path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}') | |
| do | |
| echo $EVENT_HOOK | |
| wp cron event run "$EVENT_HOOK" --url="$SITE_URL" --path="$WP_PATH" > /dev/null 2>&1 | |
| done | |
| done |
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 $wpdb; | |
| if ( is_array( $ids ) ) { | |
| $in_str_arr = array_fill( 0, count( $ids ), '%d' ); | |
| $in_str = join( ',', $in_str_arr ); | |
| $form_id_where = $wpdb->prepare( "ID IN ($in_str)", $ids ); | |
| } else { | |
| $form_id_where = $ids> 0 ? $wpdb->prepare( 'ID=%d', $ids ) : ''; | |
| } |
OlderNewer