Make WordPress Core

Ticket #25947: 25947.diff

File 25947.diff, 36.0 KB (added by dougwollison, 13 years ago)

initial patch; fixed spacing

  • wp-admin/js/editor.js

     
    1 
    21var switchEditors = {
    32
    4         switchto: function(el) {
    5                 var aid = el.id, l = aid.length, id = aid.substr(0, l - 5), mode = aid.substr(l - 4);
     3        switchto: function( el ) {
     4                var aid = el.id,
     5                        l = aid.length,
     6                        id = aid.substr( 0, l - 5 ),
     7                        mode = aid.substr( l - 4 );
    68
    79                this.go(id, mode);
    810        },
    911
    10         go: function(id, mode) { // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the "Text" editor tab.
     12        go: function( id, mode ) { // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the "Text" editor tab.
    1113                id = id || 'content';
    1214                mode = mode || 'toggle';
    1315
    14                 var t = this, ed = tinyMCE.get(id), wrap_id, txtarea_el, dom = tinymce.DOM;
     16                var t = this, ed = tinyMCE.get( id ), wrap_id, txtarea_el, dom = tinymce.DOM;
    1517
    16                 wrap_id = 'wp-'+id+'-wrap';
    17                 txtarea_el = dom.get(id);
     18                wrap_id = 'wp-' + id + '-wrap';
     19                txtarea_el = dom.get( id );
    1820
    1921                if ( 'toggle' == mode ) {
    20                         if ( ed && !ed.isHidden() )
     22                        if ( ed && ! ed.isHidden() )
    2123                                mode = 'html';
    2224                        else
    2325                                mode = 'tmce';
     
    2729                        if ( ed && ! ed.isHidden() )
    2830                                return false;
    2931
    30                         if ( typeof(QTags) != 'undefined' )
    31                                 QTags.closeAllTags(id);
     32                        if ( typeof( QTags ) != 'undefined' )
     33                                QTags.closeAllTags( id );
    3234
    33                         if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
     35                        if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop )
    3436                                txtarea_el.value = t.wpautop( txtarea_el.value );
    3537
    3638                        if ( ed ) {
    3739                                ed.show();
    3840                        } else {
    39                                 ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id]);
     41                                ed = new tinymce.Editor( id, tinyMCEPreInit.mceInit[ id ] );
    4042                                ed.render();
    4143                        }
    4244
    43                         dom.removeClass(wrap_id, 'html-active');
    44                         dom.addClass(wrap_id, 'tmce-active');
    45                         setUserSetting('editor', 'tinymce');
     45                        dom.removeClass( wrap_id, 'html-active' );
     46                        dom.addClass( wrap_id, 'tmce-active' );
     47                        setUserSetting( 'editor', 'tinymce' );
    4648
    4749                } else if ( 'html' == mode ) {
    4850
     
    5355                                ed.hide();
    5456                        } else {
    5557                                // The TinyMCE instance doesn't exist, run the content through "pre_wpautop()" and show the textarea
    56                                 if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
     58                                if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop )
    5759                                        txtarea_el.value = t.pre_wpautop( txtarea_el.value );
    5860
    59                                 dom.setStyles(txtarea_el, {'display': '', 'visibility': ''});
     61                                dom.setStyles( txtarea_el, {'display': '', 'visibility': ''} );
    6062                        }
    6163
    62                         dom.removeClass(wrap_id, 'tmce-active');
    63                         dom.addClass(wrap_id, 'html-active');
    64                         setUserSetting('editor', 'html');
     64                        dom.removeClass( wrap_id, 'tmce-active' );
     65                        dom.addClass( wrap_id, 'html-active' );
     66                        setUserSetting( 'editor', 'html' );
    6567                }
    6668                return false;
    6769        },
    6870
    69         _wp_Nop : function(content) {
    70                 var blocklist1, blocklist2, preserve_linebreaks = false, preserve_br = false;
     71        _wp_Nop: function( content ) {
     72                var blocklist1,
     73                        blocklist2,
     74                        preserve_linebreaks = false,
     75                        preserve_br = false;
    7176
    7277                // Protect pre|script tags
    73                 if ( content.indexOf('<pre') != -1 || content.indexOf('<script') != -1 ) {
     78                if ( content.indexOf( '<pre' ) != -1 || content.indexOf( '<script' ) != -1 ) {
    7479                        preserve_linebreaks = true;
    75                         content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
    76                                 a = a.replace(/<br ?\/?>(\r\n|\n)?/g, '<wp-temp-lb>');
    77                                 return a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-temp-lb>');
     80                        content = content.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
     81                                a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-temp-lb>' );
     82                                return a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-temp-lb>' );
    7883                        });
    7984                }
    8085
    8186                // keep <br> tags inside captions and remove line breaks
    82                 if ( content.indexOf('[caption') != -1 ) {
     87                if ( content.indexOf( '[caption' ) != -1 ) {
    8388                        preserve_br = true;
    84                         content = content.replace(/\[caption[\s\S]+?\[\/caption\]/g, function(a) {
    85                                 return a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>').replace(/[\r\n\t]+/, '');
     89                        content = content.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
     90                                return a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ).replace( /[\r\n\t]+/, '' );
    8691                        });
    8792                }
    8893
    8994                // Pretty it up for the source editor
    9095                blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
    91                 content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'g'), '</$1>\n');
    92                 content = content.replace(new RegExp('\\s*<((?:'+blocklist1+')(?: [^>]*)?)>', 'g'), '\n<$1>');
     96                content = content.replace( new RegExp( '\\s*</(' + blocklist1 + ')>\\s*', 'g' ), '</$1>\n' );
     97                content = content.replace( new RegExp( '\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ), '\n<$1>' );
    9398
    9499                // Mark </p> if it has any attributes.
    95                 content = content.replace(/(<p [^>]+>.*?)<\/p>/g, '$1</p#>');
     100                content = content.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' );
    96101
    97102                // Separate <div> containing <p>
    98                 content = content.replace(/<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n');
     103                content = content.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' );
    99104
    100105                // Remove <p> and <br />
    101                 content = content.replace(/\s*<p>/gi, '');
    102                 content = content.replace(/\s*<\/p>\s*/gi, '\n\n');
    103                 content = content.replace(/\n[\s\u00a0]+\n/g, '\n\n');
    104                 content = content.replace(/\s*<br ?\/?>\s*/gi, '\n');
     106                content = content.replace( /\s*<p>/gi, '' );
     107                content = content.replace( /\s*<\/p>\s*/gi, '\n\n' );
     108                content = content.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
     109                content = content.replace( /\s*<br ?\/?>\s*/gi, '\n' );
    105110
    106111                // Fix some block element newline issues
    107                 content = content.replace(/\s*<div/g, '\n<div');
    108                 content = content.replace(/<\/div>\s*/g, '</div>\n');
    109                 content = content.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n');
    110                 content = content.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption');
     112                content = content.replace( /\s*<div/g, '\n<div' );
     113                content = content.replace( /<\/div>\s*/g, '</div>\n' );
     114                content = content.replace( /\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n' );
     115                content = content.replace( /caption\]\n\n+\[caption/g, 'caption]\n\n[caption' );
    111116
    112117                blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
    113                 content = content.replace(new RegExp('\\s*<((?:'+blocklist2+')(?: [^>]*)?)\\s*>', 'g'), '\n<$1>');
    114                 content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'g'), '</$1>\n');
    115                 content = content.replace(/<li([^>]*)>/g, '\t<li$1>');
     118                content = content.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
     119                content = content.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
     120                content = content.replace( /<li([^>]*)>/g, '\t<li$1>' );
    116121
    117                 if ( content.indexOf('<hr') != -1 ) {
    118                         content = content.replace(/\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n');
     122                if ( content.indexOf( '<hr' ) != -1 ) {
     123                        content = content.replace( /\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n' );
    119124                }
    120125
    121                 if ( content.indexOf('<object') != -1 ) {
    122                         content = content.replace(/<object[\s\S]+?<\/object>/g, function(a){
    123                                 return a.replace(/[\r\n]+/g, '');
     126                if ( content.indexOf( '<object' ) != -1 ) {
     127                        content = content.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
     128                                return a.replace( /[\r\n]+/g, '' );
    124129                        });
    125130                }
    126131
    127132                // Unmark special paragraph closing tags
    128                 content = content.replace(/<\/p#>/g, '</p>\n');
    129                 content = content.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1');
     133                content = content.replace( /<\/p#>/g, '</p>\n' );
     134                content = content.replace( /\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1' );
    130135
    131136                // Trim whitespace
    132                 content = content.replace(/^\s+/, '');
    133                 content = content.replace(/[\s\u00a0]+$/, '');
     137                content = content.replace( /^\s+/, '' );
     138                content = content.replace( /[\s\u00a0]+$/, '' );
    134139
    135140                // put back the line breaks in pre|script
    136141                if ( preserve_linebreaks )
    137                         content = content.replace(/<wp-temp-lb>/g, '\n');
     142                        content = content.replace( /<wp-temp-lb>/g, '\n' );
    138143
    139144                // and the <br> tags in captions
    140145                if ( preserve_br )
    141                         content = content.replace(/<wp-temp-br([^>]*)>/g, '<br$1>');
     146                        content = content.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
    142147
    143148                return content;
    144149        },
    145150
    146         _wp_Autop : function(pee) {
     151        _wp_Autop: function(pee) {
    147152                var preserve_linebreaks = false, preserve_br = false,
    148153                        blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
    149154
    150                 if ( pee.indexOf('<object') != -1 ) {
    151                         pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){
    152                                 return a.replace(/[\r\n]+/g, '');
     155                if ( pee.indexOf( '<object' ) != -1 ) {
     156                        pee = pee.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
     157                                return a.replace( /[\r\n]+/g, '' );
    153158                        });
    154159                }
    155160
    156                 pee = pee.replace(/<[^<>]+>/g, function(a){
    157                         return a.replace(/[\r\n]+/g, ' ');
     161                pee = pee.replace( /<[^<>]+>/g, function( a ){
     162                        return a.replace( /[\r\n]+/g, ' ' );
    158163                });
    159164
    160165                // Protect pre|script tags
    161                 if ( pee.indexOf('<pre') != -1 || pee.indexOf('<script') != -1 ) {
     166                if ( pee.indexOf( '<pre' ) != -1 || pee.indexOf( '<script' ) != -1 ) {
    162167                        preserve_linebreaks = true;
    163                         pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
    164                                 return a.replace(/(\r\n|\n)/g, '<wp-temp-lb>');
     168                        pee = pee.replace( /<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function( a ) {
     169                                return a.replace( /(\r\n|\n)/g, '<wp-temp-lb>' );
    165170                        });
    166171                }
    167172
    168173                // keep <br> tags inside captions and convert line breaks
    169                 if ( pee.indexOf('[caption') != -1 ) {
     174                if ( pee.indexOf( '[caption' ) != -1 ) {
    170175                        preserve_br = true;
    171                         pee = pee.replace(/\[caption[\s\S]+?\[\/caption\]/g, function(a) {
     176                        pee = pee.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
    172177                                // keep existing <br>
    173                                 a = a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>');
     178                                a = a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' );
    174179                                // no line breaks inside HTML tags
    175                                 a = a.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(b){
    176                                         return b.replace(/[\r\n\t]+/, ' ');
     180                                a = a.replace( /<[a-zA-Z0-9]+( [^<>]+)?>/g, function( b ){
     181                                        return b.replace( /[\r\n\t]+/, ' ' );
    177182                                });
    178183                                // convert remaining line breaks to <br>
    179                                 return a.replace(/\s*\n\s*/g, '<wp-temp-br />');
     184                                return a.replace( /\s*\n\s*/g, '<wp-temp-br />' );
    180185                        });
    181186                }
    182187
    183188                pee = pee + '\n\n';
    184                 pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');
    185                 pee = pee.replace(new RegExp('(<(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), '\n$1');
    186                 pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '$1\n\n');
    187                 pee = pee.replace(/<hr( [^>]*)?>/gi, '<hr$1>\n\n'); // hr is self closing block element
    188                 pee = pee.replace(/\r\n|\r/g, '\n');
    189                 pee = pee.replace(/\n\s*\n+/g, '\n\n');
    190                 pee = pee.replace(/([\s\S]+?)\n\n/g, '<p>$1</p>\n');
    191                 pee = pee.replace(/<p>\s*?<\/p>/gi, '');
    192                 pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
    193                 pee = pee.replace(/<p>(<li.+?)<\/p>/gi, '$1');
    194                 pee = pee.replace(/<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
    195                 pee = pee.replace(/<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
    196                 pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), "$1");
    197                 pee = pee.replace(new RegExp('(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
    198                 pee = pee.replace(/\s*\n/gi, '<br />\n');
    199                 pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
    200                 pee = pee.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1');
    201                 pee = pee.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]');
     189                pee = pee.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
     190                pee = pee.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n$1' );
     191                pee = pee.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
     192                pee = pee.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // hr is self closing block element
     193                pee = pee.replace( /\r\n|\r/g, '\n' );
     194                pee = pee.replace( /\n\s*\n+/g, '\n\n' );
     195                pee = pee.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' );
     196                pee = pee.replace( /<p>\s*?<\/p>/gi, '');
     197                pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), "$1" );
     198                pee = pee.replace( /<p>(<li.+?)<\/p>/gi, '$1');
     199                pee = pee.replace( /<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
     200                pee = pee.replace( /<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
     201                pee = pee.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), "$1" );
     202                pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), "$1" );
     203                pee = pee.replace( /\s*\n/gi, '<br />\n');
     204                pee = pee.replace( new RegExp( '(</?(?:' + blocklist + ')[^>]*>)\\s*<br />', 'gi' ), "$1" );
     205                pee = pee.replace( /<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1' );
     206                pee = pee.replace( /(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]' );
    202207
    203                 pee = pee.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function(a, b, c) {
    204                         if ( c.match(/<p( [^>]*)?>/) )
     208                pee = pee.replace( /(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function( a, b, c ) {
     209                        if ( c.match( /<p( [^>]*)?>/ ) )
    205210                                return a;
    206211
    207212                        return b + '<p>' + c + '</p>';
     
    209214
    210215                // put back the line breaks in pre|script
    211216                if ( preserve_linebreaks )
    212                         pee = pee.replace(/<wp-temp-lb>/g, '\n');
     217                        pee = pee.replace( /<wp-temp-lb>/g, '\n' );
    213218
    214219                if ( preserve_br )
    215                         pee = pee.replace(/<wp-temp-br([^>]*)>/g, '<br$1>');
     220                        pee = pee.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
    216221
    217222                return pee;
    218223        },
    219224
    220         pre_wpautop : function(content) {
     225        pre_wpautop: function( content ) {
    221226                var t = this, o = { o: t, data: content, unfiltered: content },
    222                         q = typeof(jQuery) != 'undefined';
     227                        q = typeof( jQuery ) != 'undefined';
    223228
    224229                if ( q )
    225                         jQuery('body').trigger('beforePreWpautop', [o]);
    226                 o.data = t._wp_Nop(o.data);
     230                        jQuery( 'body' ).trigger( 'beforePreWpautop', [ o ] );
     231                o.data = t._wp_Nop( o.data );
    227232                if ( q )
    228                         jQuery('body').trigger('afterPreWpautop', [o]);
     233                        jQuery('body').trigger('afterPreWpautop', [ o ] );
    229234
    230235                return o.data;
    231236        },
    232237
    233         wpautop : function(pee) {
     238        wpautop: function( pee ) {
    234239                var t = this, o = { o: t, data: pee, unfiltered: pee },
    235                         q = typeof(jQuery) != 'undefined';
     240                        q = typeof( jQuery ) != 'undefined';
    236241
    237242                if ( q )
    238                         jQuery('body').trigger('beforeWpautop', [o]);
    239                 o.data = t._wp_Autop(o.data);
     243                        jQuery( 'body' ).trigger('beforeWpautop', [ o ] );
     244                o.data = t._wp_Autop( o.data );
    240245                if ( q )
    241                         jQuery('body').trigger('afterWpautop', [o]);
     246                        jQuery( 'body' ).trigger('afterWpautop', [ o ] );
    242247
    243248                return o.data;
    244249        }
    245 }
     250};
     251 No newline at end of file
  • wp-includes/query.php

     
    17091709                $this->query_vars_hash = md5( serialize( $this->query_vars ) );
    17101710                $this->query_vars_changed = false;
    17111711
    1712                 do_action_ref_array('parse_query', array(&$this));
     1712                /**
     1713                 * Fires after parse_query is complete.
     1714                 *
     1715                 * @since 1.5.2
     1716                 *
     1717                 * @param WP_Query &$this The WP_Query instance (passed by reference).
     1718                 */
     1719                do_action_ref_array( 'parse_query', array( &$this ) );
    17131720        }
    17141721
    17151722        /**
     
    19161923
    19171924                $this->tax_query = new WP_Tax_Query( $tax_query );
    19181925
     1926                /**
     1927                 * Fires after parse_tax_query is complete.
     1928                 *
     1929                 * @since 3.7.0
     1930                 *
     1931                 * @param WP_Query $this The WP_Query instance.
     1932                 */
    19191933                do_action( 'parse_tax_query', $this );
    19201934        }
    19211935
     
    21512165
    21522166                $this->parse_query();
    21532167
    2154                 do_action_ref_array('pre_get_posts', array(&$this));
     2168                /**
     2169                 * Fires after the query variable object is created, but before the actual query is run.
     2170                 *
     2171                 * Note: keep in mind the context of any conditional tags you use. For example, to test
     2172                 * if THIS instance is the main query, use $this->is_main_query(). This is because the
     2173                 * global function versions, such as is_main_query(), are run on the global $wp_query instance.
     2174                 *
     2175                 * @since 2.0.0
     2176                 *
     2177                 * @param WP_Query &$this The WP_Query instance (passed by reference).
     2178                 */
     2179                do_action_ref_array( 'pre_get_posts', array( &$this ) );
    21552180
    21562181                // Shorthand.
    21572182                $q = &$this->query_vars;
     
    27912816                // Apply filters on where and join prior to paging so that any
    27922817                // manipulations to them are reflected in the paging by day queries.
    27932818                if ( !$q['suppress_filters'] ) {
    2794                         $where = apply_filters_ref_array('posts_where', array( $where, &$this ) );
    2795                         $join = apply_filters_ref_array('posts_join', array( $join, &$this ) );
     2819                        /**
     2820                         * Filter the WHERE clause of the query.
     2821                         *
     2822                         * @since 1.5.2
     2823                         *
     2824                         * @param string   $where The WHERE clause of the query.
     2825                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2826                         */
     2827                        $where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) );
     2828
     2829                        /**
     2830                         * Filter the JOIN clause of the query.
     2831                         *
     2832                         * @since 1.5.2
     2833                         *
     2834                         * @param string   $where The JOIN clause of the query.
     2835                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2836                         */
     2837                        $join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) );
    27962838                }
    27972839
    27982840                // Paging
     
    28232865                        }
    28242866
    28252867                        if ( !$q['suppress_filters'] ) {
    2826                                 $cjoin = apply_filters_ref_array('comment_feed_join', array( $cjoin, &$this ) );
    2827                                 $cwhere = apply_filters_ref_array('comment_feed_where', array( $cwhere, &$this ) );
    2828                                 $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( $cgroupby, &$this ) );
    2829                                 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
    2830                                 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     2868                                /**
     2869                                 * Filter the JOIN clause of the comments feed query before sending.
     2870                                 *
     2871                                 * @since 1.5.2
     2872                                 *
     2873                                 * @param string   $cjoin The JOIN clause of the query.
     2874                                 * @param WP_Query &$this The WP_Query instance (passed by reference).
     2875                                 */
     2876                                $cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) );
     2877
     2878                                /**
     2879                                 * Filter the WHERE clause of the comments feed query before sending.
     2880                                 *
     2881                                 * @since 1.5.2
     2882                                 *
     2883                                 * @param string   $cwhere The WHERE clause of the query.
     2884                                 * @param WP_Query &$this  The WP_Query instance (passed by reference).
     2885                                 */
     2886                                $cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) );
     2887
     2888                                /**
     2889                                 * Filter the GROUP BY clause of the comments feed query before sending.
     2890                                 *
     2891                                 * @since 1.5.2
     2892                                 *
     2893                                 * @param string   $cgroupby The GROUP BY clause of the query.
     2894                                 * @param WP_Query &$this    The WP_Query instance (passed by reference).
     2895                                 */
     2896                                $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) );
     2897
     2898                                /**
     2899                                 * Filter the ORDER BY clause of the comments feed query before sending.
     2900                                 *
     2901                                 * @since 1.5.2
     2902                                 *
     2903                                 * @param string   $corderby The ORDER BY clause of the query.
     2904                                 * @param WP_Query &$this    The WP_Query instance (passed by reference).
     2905                                 */
     2906                                $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
     2907
     2908                                /**
     2909                                 * Filter the LIMIT clause of the comments feed query before sending.
     2910                                 *
     2911                                 * @since 1.5.2
     2912                                 *
     2913                                 * @param string   $climits The JOIN clause of the query.
     2914                                 * @param WP_Query &$this   The WP_Query instance (passed by reference).
     2915                                 */
     2916                                $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
    28312917                        }
    28322918                        $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    28332919                        $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
     
    28502936
    28512937                $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
    28522938
    2853                 // Apply post-paging filters on where and join. Only plugins that
    2854                 // manipulate paging queries should use these hooks.
    28552939                if ( !$q['suppress_filters'] ) {
     2940                        /**
     2941                         * Filter the WHERE clause of the query.
     2942                         *
     2943                         * Specifically for manipulating paging queries.
     2944                         *
     2945                         * @since 1.5.2
     2946                         *
     2947                         * @param string   $where The WHERE clause of the query.
     2948                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2949                         */
    28562950                        $where          = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );
     2951
     2952                        /**
     2953                         * Filter the GROUP BY clause of the query.
     2954                         *
     2955                         * @since 2.0.0
     2956                         *
     2957                         * @param string   $groupby The GROUP BY clause of the query.
     2958                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     2959                         */
    28572960                        $groupby        = apply_filters_ref_array( 'posts_groupby',             array( $groupby, &$this ) );
     2961
     2962                        /**
     2963                         * Filter the JOIN clause of the query.
     2964                         *
     2965                         * Specifically for manipulating paging queries.
     2966                         *
     2967                         * @since 1.5.2
     2968                         *
     2969                         * @param string   $join  The JOIN clause of the query.
     2970                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     2971                         */
    28582972                        $join           = apply_filters_ref_array( 'posts_join_paged',  array( $join, &$this ) );
     2973
     2974                        /**
     2975                         * Filter the ORDER BY clause of the query.
     2976                         *
     2977                         * @since 1.5.2
     2978                         *
     2979                         * @param string   $orderby The ORDER BY clause of the query.
     2980                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     2981                         */
    28592982                        $orderby        = apply_filters_ref_array( 'posts_orderby',             array( $orderby, &$this ) );
     2983
     2984                        /**
     2985                         * Filter the DISTINCT clause of the query.
     2986                         *
     2987                         * @since 2.1.0
     2988                         *
     2989                         * @param string   $distinct The DISTINCT clause of the query.
     2990                         * @param WP_Query &$this    The WP_Query instance (passed by reference).
     2991                         */
    28602992                        $distinct       = apply_filters_ref_array( 'posts_distinct',    array( $distinct, &$this ) );
     2993
     2994                        /**
     2995                         * Filter the LIMIT clause of the query.
     2996                         *
     2997                         * @since 2.1.0
     2998                         *
     2999                         * @param string   $limits The LIMIT clause of the query.
     3000                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3001                         */
    28613002                        $limits         = apply_filters_ref_array( 'post_limits',               array( $limits, &$this ) );
     3003
     3004                        /**
     3005                         * Filter the SELECT clause of the query.
     3006                         *
     3007                         * @since 2.1.0
     3008                         *
     3009                         * @param string   $fields The SELECT clause of the query.
     3010                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3011                         */
    28623012                        $fields         = apply_filters_ref_array( 'posts_fields',              array( $fields, &$this ) );
    28633013
    2864                         // Filter all clauses at once, for convenience
    2865                         $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
     3014                        $clauses = compact( $pieces );
     3015                        /**
     3016                         * Filter all clauses at once, for convenience.
     3017                         *
     3018                         * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,
     3019                         * fields (SELECT), and LIMITS clauses.
     3020                         *
     3021                         * @since 3.1.0
     3022                         *
     3023                         * @param array    $clauses The list of clauses for the query.
     3024                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3025                         */
     3026                        $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( $clauses, &$this ) );
     3027
    28663028                        foreach ( $pieces as $piece )
    28673029                                $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
    28683030                }
    28693031
    2870                 // Announce current selection parameters. For use by caching plugins.
    2871                 do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
     3032                $selection = $where . $groupby . $orderby . $limits . $join;
     3033                /**
     3034                 * Fires to announce current selection parameters.
     3035                 *
     3036                 * For use by caching plugins.
     3037                 *
     3038                 * @since 2.3.0
     3039                 *
     3040                 * @param string $selection The assembled selection query.
     3041                 */
     3042                do_action( 'posts_selection', $selection );
    28723043
    28733044                // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
    28743045                if ( !$q['suppress_filters'] ) {
     3046                        /**
     3047                         * Filter the WHERE clause of the query.
     3048                         *
     3049                         * For use by caching plugins.
     3050                         *
     3051                         * @since 2.5.0
     3052                         *
     3053                         * @param string   $where The WHERE clause of the query.
     3054                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3055                         */
    28753056                        $where          = apply_filters_ref_array( 'posts_where_request',               array( $where, &$this ) );
     3057
     3058                        /**
     3059                         * Filter the GROUP BY clause of the query.
     3060                         *
     3061                         * For use by caching plugins.
     3062                         *
     3063                         * @since 2.5.0
     3064                         *
     3065                         * @param string   $groupby The GROUP BY clause of the query.
     3066                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     3067                         */
    28763068                        $groupby        = apply_filters_ref_array( 'posts_groupby_request',             array( $groupby, &$this ) );
     3069
     3070                        /**
     3071                         * Filter the JOIN clause of the query.
     3072                         *
     3073                         * For use by caching plugins.
     3074                         *
     3075                         * @since 2.5.0
     3076                         *
     3077                         * @param string   $join  The JOIN clause of the query.
     3078                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3079                         */
    28773080                        $join           = apply_filters_ref_array( 'posts_join_request',                array( $join, &$this ) );
     3081
     3082                        /**
     3083                         * Filter the ORDER BY clause of the query.
     3084                         *
     3085                         * For use by caching plugins.
     3086                         *
     3087                         * @since 2.5.0
     3088                         *
     3089                         * @param string   $orderby The ORDER BY clause of the query.
     3090                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     3091                         */
    28783092                        $orderby        = apply_filters_ref_array( 'posts_orderby_request',             array( $orderby, &$this ) );
     3093
     3094                        /**
     3095                         * Filter the DISTINCT clause of the query.
     3096                         *
     3097                         * For use by caching plugins.
     3098                         *
     3099                         * @since 2.5.0
     3100                         *
     3101                         * @param string   $distinct The DISTINCT clause of the query.
     3102                         * @param WP_Query &$this    The WP_Query instance (passed by reference).
     3103                         */
    28793104                        $distinct       = apply_filters_ref_array( 'posts_distinct_request',    array( $distinct, &$this ) );
     3105
     3106                        /**
     3107                         * Filter the SELECT clause of the query.
     3108                         *
     3109                         * For use by caching plugins.
     3110                         *
     3111                         * @since 2.5.0
     3112                         *
     3113                         * @param string   $fields The SELECT clause of the query.
     3114                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3115                         */
    28803116                        $fields         = apply_filters_ref_array( 'posts_fields_request',              array( $fields, &$this ) );
     3117
     3118                        /**
     3119                         * Filter the LIMIT clause of the query.
     3120                         *
     3121                         * For use by caching plugins.
     3122                         *
     3123                         * @since 2.5.0
     3124                         *
     3125                         * @param string   $limits The LIMIT clause of the query.
     3126                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3127                         */
    28813128                        $limits         = apply_filters_ref_array( 'post_limits_request',               array( $limits, &$this ) );
    28823129
    2883                         // Filter all clauses at once, for convenience
    2884                         $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
     3130                        $clauses = compact( $pieces );
     3131                        /**
     3132                         * Filter all clauses at once, for convenience.
     3133                         *
     3134                         * For use by caching plugins.
     3135                         *
     3136                         * Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,
     3137                         * fields (SELECT), and LIMITS clauses.
     3138                         *
     3139                         * @since 3.1.0
     3140                         *
     3141                         * @param array    $pieces The pieces of the query.
     3142                         * @param WP_Query &$this  The WP_Query instance (passed by reference).
     3143                         */
     3144                        $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( $clauses, &$this ) );
    28853145                        foreach ( $pieces as $piece )
    28863146                                $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
    28873147                }
     
    28983158                $this->request = $old_request = "SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    28993159
    29003160                if ( !$q['suppress_filters'] ) {
    2901                         $this->request = apply_filters_ref_array( 'posts_request', array( $this->request, &$this ) );
     3161                        $request = $this->request;
     3162                        /**
     3163                         * Filter the completed SQL query before sending.
     3164                         *
     3165                         * @since 2.0.0
     3166                         *
     3167                         * @param array    $request The complete SQL query.
     3168                         * @param WP_Query &$this   The WP_Query instance (passed by reference).
     3169                         */
     3170                        $this->request = apply_filters_ref_array( 'posts_request', array( $request, &$this ) );
    29023171                }
    29033172
    29043173                if ( 'ids' == $q['fields'] ) {
     
    29223191                }
    29233192
    29243193                $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 );
     3194
     3195                /**
     3196                 * Filter the $split_the_query boolean.
     3197                 *
     3198                 * Splitting the query will cause it to fetch just the IDs of the found posts
     3199                 * (and then individually fetch each post by ID), rather than fetching every
     3200                 * complete row at once. One massive result vs. many small results.
     3201                 *
     3202                 * @since 3.4.0
     3203                 *
     3204                 * @param bool     $split_the_query Whether or not to split the query.
     3205                 * @param WP_Query $this            The WP_Query instance.
     3206                 */
    29253207                $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );
    29263208
    29273209                if ( $split_the_query ) {
     
    29293211
    29303212                        $this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
    29313213
    2932                         $this->request = apply_filters( 'posts_request_ids', $this->request, $this );
     3214                        $request = $this->request;
     3215                        /**
     3216                         * Filter the Post IDs SQL request before sending.
     3217                         *
     3218                         * @since 3.4.0
     3219                         *
     3220                         * @param string   $request The post ID request.
     3221                         * @param WP_Query $this    The WP_Query instance.
     3222                         */
     3223                        $this->request = apply_filters( 'posts_request_ids', $request, $this );
    29333224
    29343225                        $ids = $wpdb->get_col( $this->request );
    29353226
     
    29493240                if ( $this->posts )
    29503241                        $this->posts = array_map( 'get_post', $this->posts );
    29513242
    2952                 // Raw results filter. Prior to status checks.
    2953                 if ( !$q['suppress_filters'] )
    2954                         $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) );
     3243                if ( !$q['suppress_filters'] ){
     3244                        $posts = $this->posts;
     3245                        /**
     3246                         * Filter the raw post results array, prior to status checks.
     3247                         *
     3248                         * @since 2.3.0
     3249                         *
     3250                         * @param array    $posts The post results array.
     3251                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3252                         */
     3253                        $this->posts = apply_filters_ref_array( 'posts_results', array( $posts, &$this ) );
     3254                }
    29553255
    29563256                if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {
    2957                         $cjoin = apply_filters_ref_array('comment_feed_join', array( '', &$this ) );
    2958                         $cwhere = apply_filters_ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
    2959                         $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( '', &$this ) );
     3257                        // duplicate_hook
     3258                        $cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) );
     3259
     3260                        // duplicate_hook
     3261                        $cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );
     3262
     3263                        // duplicate_hook
     3264                        $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) );
    29603265                        $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
    2961                         $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
     3266
     3267                        // duplicate_hook
     3268                        $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
    29623269                        $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
    2963                         $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     3270
     3271                        // duplicate_hook
     3272                        $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );
     3273
    29643274                        $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits";
    29653275                        $this->comments = $wpdb->get_results($comments_request);
    29663276                        $this->comment_count = count($this->comments);
     
    29943304                                }
    29953305                        }
    29963306
    2997                         if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) )
    2998                                 $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $this->posts[0], &$this ) ) );
     3307                        if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) ){
     3308                                $post_preview = $this->posts[0];
     3309                                /**
     3310                                 * Filter the single post for preview mode.
     3311                                 *
     3312                                 * @since 2.7.0
     3313                                 *
     3314                                 * @param WP_Post  $post_preview  The Post object.
     3315                                 * @param WP_Query &$this         The WP_Query instance (passed by reference).
     3316                                 */
     3317                                $this->posts[0] = get_post( apply_filters_ref_array( 'the_preview', array( $post_preview, &$this ) ) );
     3318                        }
    29993319                }
    30003320
    30013321                // Put sticky posts at the top of the posts array
     
    30393359                        }
    30403360                }
    30413361
    3042                 if ( !$q['suppress_filters'] )
    3043                         $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) );
     3362                if ( !$q['suppress_filters'] ){
     3363                        $posts = $this->posts;
     3364                        /**
     3365                         * Filter the array of retrieved posts after they've been fetched and
     3366                         * internally processed.
     3367                         *
     3368                         * @since 1.5.2
     3369                         *
     3370                         * @param array    $posts The array of retrieved posts.
     3371                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3372                         */
     3373                        $this->posts = apply_filters_ref_array( 'the_posts', array( $posts, &$this ) );
     3374                }
    30443375
    30453376                // Ensure that any posts added/modified via one of the filters above are
    30463377                // of the type WP_Post and are filtered.
     
    30763407                if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) )
    30773408                        return;
    30783409
    3079                 if ( ! empty( $limits ) )
    3080                         $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
    3081                 else
     3410                if ( ! empty( $limits ) ){
     3411                        $found_posts = 'SELECT FOUND_ROWS()';
     3412                        /**
     3413                         * Filter the query to run for retrieving the found posts.
     3414                         *
     3415                         * @since 2.1.0
     3416                         *
     3417                         * @param string   $found_posts The query to run to find the found posts.
     3418                         * @param WP_Query &$this       The WP_Query instance (passed by reference).
     3419                         */
     3420                        $this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( $found_posts, &$this ) ) );
     3421                }
     3422                else{
    30823423                        $this->found_posts = count( $this->posts );
     3424                }
    30833425
    3084                 $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
     3426                $found_posts = $this->found_posts;
     3427                /**
     3428                 * Filter the number of found posts.
     3429                 *
     3430                 * @since 2.1.0
     3431                 *
     3432                 * @param int      $found_posts The number of posts found.
     3433                 * @param WP_Query &$this       The WP_Query instance (passed by reference).
     3434                 */
     3435                $this->found_posts = apply_filters_ref_array( 'found_posts', array( $found_posts, &$this ) );
    30853436
    30863437                if ( ! empty( $limits ) )
    30873438                        $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
     
    31193470                $this->in_the_loop = true;
    31203471
    31213472                if ( $this->current_post == -1 ) // loop has just started
    3122                         do_action_ref_array('loop_start', array(&$this));
     3473                        /**
     3474                         * Fires once the loop is started.
     3475                         *
     3476                         * @since 2.0.0
     3477                         *
     3478                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3479                         */
     3480                        do_action_ref_array( 'loop_start', array( &$this ) );
    31233481
    31243482                $post = $this->next_post();
    31253483                setup_postdata($post);
     
    31403498                if ( $this->current_post + 1 < $this->post_count ) {
    31413499                        return true;
    31423500                } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
    3143                         do_action_ref_array('loop_end', array(&$this));
     3501                        /**
     3502                         * Fires once the loop has ended.
     3503                         *
     3504                         * @since 2.0.0
     3505                         *
     3506                         * @param WP_Query &$this The WP_Query instance (passed by reference).
     3507                         */
     3508                        do_action_ref_array( 'loop_end', array( &$this ) );
    31443509                        // Do some cleaning up after the loop
    31453510                        $this->rewind_posts();
    31463511                }
     
    31913556                $comment = $this->next_comment();
    31923557
    31933558                if ( $this->current_comment == 0 ) {
    3194                         do_action('comment_loop_start');
     3559                        /**
     3560                         * Fires once the comment loop is started.
     3561                         *
     3562                         * @since 2.2.0
     3563                         */
     3564                        do_action( 'comment_loop_start' );
    31953565                }
    31963566        }
    31973567
     
    39574327                $pages = array( $post->post_content );
    39584328        }
    39594329
    3960         do_action_ref_array('the_post', array(&$post));
     4330        /**
     4331         * Fires once the post data has been setup.
     4332         *
     4333         * @since 2.8.0
     4334         *
     4335         * @param WP_Post &$post The Post object (passed by reference).
     4336         */
     4337        do_action_ref_array( 'the_post', array( &$post ) );
    39614338
    39624339        return true;
    39634340}