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_filter( 's3_uploads_s3_client_params', function ( $params ) { | |
| if ( defined( 'S3_UPLOADS_ENDPOINT' ) ) { | |
| $params['endpoint'] = S3_UPLOADS_ENDPOINT; | |
| } | |
| return $params; | |
| }, 5, 1 ); | 
  
    
      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
    
  
  
    
  | public function migrate1( $args, $assoc_args ) { | |
| global $wpdb; | |
| $user_list = $wpdb->get_col( "SELECT ID FROM $wpdb->users;" ); | |
| // Number of users returned by query | |
| $found_users = count( $user_list ); | |
| // Generate progess bar | |
| $progress = new \cli\progress\Bar( 'Progress', $found_users ); | 
  
    
      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_filter( 'get_user_metadata', function ( $value, $object_id, $meta_key, $single ) { | |
| if ( 'admin_color' !== $meta_key || ! $single ) { | |
| return $value; | |
| } | |
| if ( ! defined( 'WPCOM_IS_VIP_ENV' ) ) { | |
| return $value; | |
| } | |
| switch ( WPCOM_IS_VIP_ENV ) { | |
| case 'develop': | 
  
    
      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
    
  
  
    
  | Create table | |
| Remove Table | |
| Activate | |
| Uninstall | 
  
    
      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_site_id_of_user( $user_id, $all = false ) { | |
| global $wpdb; | |
| $user_id = (int) $user_id; | |
| // Logged out users can't have sites | |
| if ( empty( $user_id ) ) { | |
| return array(); | |
| } | |
| $keys = get_user_meta( $user_id ); | |
| if ( empty( $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
    
  
  
    
  | Changes to 5.1 | |
| Multisite | |
| https://core.trac.wordpress.org/ticket/37923 | |
| https://core.trac.wordpress.org/ticket/40364 | |
| https://core.trac.wordpress.org/ticket/44368 | |
| https://core.trac.wordpress.org/ticket/41333 | |
| https://core.trac.wordpress.org/ticket/40647 | 
  
    
      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( 'rest_api_init', function () { | |
| $types = get_post_types( | |
| [ | |
| 'show_in_rest' => true, | |
| ], | |
| 'names' | |
| ); | 
  
    
      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.apiFetch( { path: '/wp/v2/types' } ).then( ( post_types ) => { | |
| for ( let post_type in post_types ){ | |
| let {rest_base} = post_types[post_type]; | |
| wp.apiFetch( { path: '/wp/v2/' + rest_base } ).then( ( posts ) => { | |
| console.log(posts); | |
| }); | |
| } | |
| } ); | 
  
    
      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
    
  
  
    
  | public function get_item_permissions_check( $request ) { | |
| $post = $this->get_post( $request['id'] ); | |
| if ( is_wp_error( $post ) ) { | |
| return $post; | |
| } | |
| if ( $post && ! $this->check_update_permission( $post ) ) { | |
| return false; | |
| } | |
| return parent::get_item_permissions_check( $request ); | 
  
    
      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
    
  
  
    
  | Functions | |
| startElement | |
| endElement | |
| _wp_menu_output | |
| _add_themes_utility_last | |
| _wp_ajax_delete_comment_response | |
| _wp_ajax_add_hierarchical_term | |
| wp_link_manager_disabled_message | |
| _wp_credits_add_profile_link |