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
    
  
  
    
  | // Init REST Route | |
| function register_custom_api_hooks() { | |
| $namespace = 'custom-name/v1'; | |
| register_rest_route( $namespace, '/posts/', array( | |
| 'methods' => 'GET', | |
| 'callback' => 'custom_api_get_posts', | |
| ) ); | |
| } | |
| add_action( 'rest_api_init', 'register_custom_api_hooks' ); | 
  
    
      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 your_function(){ | |
| // **** Add your function here **** | |
| } | |
| add_action( 'your_cron_action', 'your_function' ); | |
| // Init Cron Job | |
| function init_custom_cron() { | |
| if( !wp_next_scheduled( 'your_cron_action' ) ){ | |
| wp_schedule_event( time(), '20min', 'your_cron_action' ); | |
| } | 
  
    
      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 goyippi_embed_header() { | |
| wp_deregister_style('open-sans'); | |
| wp_enqueue_style( 'goyippi-embed-font', 'http://fonts.googleapis.com/css?family=Droid+Sans:400,700','','', 'all' ); | |
| wp_enqueue_style( 'goyippi-embed-styles', get_bloginfo('stylesheet_directory').'/wp-style_embed.css','','', 'all' ); | |
| } | |
| add_action( 'embed_head', 'goyippi_embed_header' ); | 
  
    
      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 reverse_srcset_order($atts) { | |
| if (isset($atts['srcset'])) { | |
| $srcset = explode(', ', $atts['srcset']); | |
| $srcset_reversed = array_reverse($srcset); | |
| $atts['srcset'] = join(', ', $srcset_reversed); | |
| } | |
| return $atts; | |
| } | |
| add_filter('wp_get_attachment_image_attributes','reverse_srcset_order',1,1); | 
NewerOlder