Make WordPress Core

Changeset 38465


Ignore:
Timestamp:
08/31/2016 06:24:57 AM (8 years ago)
Author:
wonderboymusic
Message:

Press This: in wp_ajax_press_this_save_post() and wp_ajax_press_this_add_category(), don't check for a global instance. WP_Press_This is a Controller, but not really a Singleton. This also keeps it from being a pluggable class, which it is right now.

See #37699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r38455 r38465  
    31143114 *
    31153115 * @since 4.2.0
    3116  *
    3117  * @global WP_Press_This $wp_press_this
    31183116 */
    31193117function wp_ajax_press_this_save_post() {
    3120     if ( empty( $GLOBALS['wp_press_this'] ) ) {
    3121         $GLOBALS['wp_press_this'] = new WP_Press_This();
    3122     }
    3123 
    3124     $GLOBALS['wp_press_this']->save_post();
     3118    $wp_press_this = new WP_Press_This();
     3119    $wp_press_this->save_post();
    31253120}
    31263121
     
    31293124 *
    31303125 * @since 4.2.0
    3131  *
    3132  * @global WP_Press_This $wp_press_this
    31333126 */
    31343127function wp_ajax_press_this_add_category() {
    3135     if ( empty( $GLOBALS['wp_press_this'] ) ) {
    3136         $GLOBALS['wp_press_this'] = new WP_Press_This();
    3137     }
    3138 
    3139     $GLOBALS['wp_press_this']->add_category();
     3128    $wp_press_this = new WP_Press_This();
     3129    $wp_press_this->add_category();
    31403130}
    31413131
Note: See TracChangeset for help on using the changeset viewer.