Skip to content
Permalink
Branch: master
Commits on Sep 19, 2019
  1. Query: Expand the list of operators available to `compare_key` in `WP…

    boonebgorges committed Sep 19, 2019
    …_Meta_Query`.
    
    `compare_key`, introduced in #42409, previously supported only `=` and `LIKE`
    operators. This changeset introduces a number of other operators: `!=`, `IN`,
    `NOT IN`, `NOT LIKE`, `RLIKE`, `REGEXP`, `NOT REGEXP`, `EXISTS`, and `NOT EXISTS`
    (the latter two aliased to `=` and `!=`, respectively). To support case-sensitive
    regular expression key comparisons, the new `type_key` parameter will force
    a MySQL `CAST` when 'BINARY' is passed.
    
    Props soulseekah.
    Fixes #43346.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@46188 602fd350-edb4-49c9-b593-d223f7449a82
  2. Improve performance of trackback query in `do_all_pings()`.

    boonebgorges committed Sep 19, 2019
    Previously, the direct SQL query used to identify trackbacks in
    `do_all_pings()` performed poorly, due to an unindexed query against the
    `to_ping` column. We improve performance in two ways. First, we switch
    to using a postmeta flag for posts that require trackbacks to be sent;
    queries joining against the postmeta table that check only the `meta_key`
    are generally quite fast. Second, we switch to the use of `WP_Query`,
    making the query cacheable and filterable using standard methods.
    
    Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
    Fixes #36824.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@46178 602fd350-edb4-49c9-b593-d223f7449a82
  3. Use `WP_Query` when sending pingbacks.

    boonebgorges committed Sep 19, 2019
    Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
    See #36824.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@46177 602fd350-edb4-49c9-b593-d223f7449a82
  4. PHPCS: Fix coding standards violations in `do_enclose()`.

    boonebgorges committed Sep 19, 2019
    * Use strict checking when appropriate in `in_array()` checks.
    * Improved comment formatting.
    * Yoda and strict equality checks where appropriate.
    
    See #36824.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@46176 602fd350-edb4-49c9-b593-d223f7449a82
  5. Improve `do_enclose()` logic on post publish.

    boonebgorges committed Sep 19, 2019
    Removing the direct SQL query in `do_all_pings()` improves filterability.
    
    As part of this change, the signature of `do_enclose()` is changed so that
    a null `$content` parameter can be passed, with the `$content` then inferred
    from the `$post` passed in the second parameter. In addition, the second
    parameter was modified so that a post ID or a `WP_Post` object can be
    provided. These changes make it possible to trigger enclosure checks with
    a post ID alone (as in `do_all_pings()`) and also brings the function
    signature in line with `do_trackbacks()` and `pingback()`.
    
    Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
    See #36824.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@46175 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Aug 26, 2019
  1. Taxonomy: Standardize docs for `wp_list_categories()`.

    boonebgorges committed Aug 26, 2019
    Many of the parameters historically documented on this function are merely
    passed through to `get_categories()` and its underlying functions. In order to
    avoid unnecessary duplication of function arguments, we remove documentation of
    these parameters, and replace it with reference to the wrapped functions.
    
    Parameters that receive special treatment or are otherwise changed before
    being passed through continue to be documented as part of `wp_list_categories()`.
    
    Props audrasjb, itowhid06, birgire.
    Fixes #47896.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@45894 602fd350-edb4-49c9-b593-d223f7449a82
  2. Taxonomy: Fix unique-slug check for terms with parents.

    boonebgorges committed Aug 26, 2019
    `wp_unique_term_slug()` appends numeric suffixes when the requested slug is
    already in use by a sibling term. Changes introduced in [32837] inadvertently
    caused this suffixing to be skipped in cases where the requested slug is
    suffixed with the parent slug, so that it became possible to have two terms
    `childslug-parentslug` underneath to the same `parentslug`. We fix this
    regression by ensuring that the numeric-suffix routine runs in all cases.
    
    Props yashar_hv, saskak, dlh.
    Fixes #46431.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@45893 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Aug 23, 2019
  1. Taxonomy: Ensure consistency of `hide_empty` in term queries when `ta…

    boonebgorges committed Aug 23, 2019
    …xonomy` is excluded.
    
    When querying for terms in hierarchical categories using `hide_empty=true`,
    results have historically included parent terms which are themselves
    unattached to any objects (are "empty") but which have non-empty descendent
    terms. Because this process involves walking the descendant tree, we avoid it
    when we detect that the queried taxonomies are not hierarchical. (This
    behavior was introduced in [5525].)
    
    When the `taxonomy` parameter of `get_terms()` was made optional - see #35495,
    [36614] - it affected the mechanism for avoiding unneccessary tree walks,
    since there may not be any explicitly declared taxonomies to run through
    `is_taxonomy_hierarchical()`. As a result, term queries excluding `taxonomy`
    did not check descendants, and empty parents with non-empty children were not
    included in `hide_empty` results.
    
    We correct the behavior by crawling term descendants when the `taxonomy`
    argument is absent, which means that we're querying for terms in all taxonomies.
    
    Props smerriman.
    Fixes #37728.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@45888 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Mar 20, 2019
  1. Posts: Avoid the use of globals in `get_the_content()` and related fu…

    boonebgorges committed Mar 20, 2019
    …nctions.
    
    This changeset introduces `$post` parameters to `get_the_content()` and
    `wp_trim_excerpt()`. When a `$post` object is passed to one of these functions,
    the functions will operate on the data from that object, rather than from the
    post globals (`$authordata`, `$page`, etc). This ensures that the functions work
    in a predictable manner when used outside of the regular post loop.
    
    The global-mismatch problem is surfaced in cases where `get_the_excerpt()` is
    called outside of the post loop, on posts that don't have a defined excerpt. In
    these cases, the post globals - used to generate a fallback excerpt - may refer
    to the incorrect object, resulting in PHP notices or other unpredictable
    behavior. See #36934 for a related issue.
    
    Props spacedmonkey, kraftbj, Shital Patel.
    Fixes #42814.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44941 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Mar 8, 2019
  1. Taxonomy: Introduce `post_column_taxonomy_links`.

    boonebgorges committed Mar 8, 2019
    This filter allows plugin developers to modify the markup for the links
    in taxonomy columns on edit.php.
    
    Props DaveFX.
    Fixes #42669.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44822 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Mar 7, 2019
  1. Taxonomy: Add `level-n` classes to rows on edit-tags.php.

    boonebgorges committed Mar 7, 2019
    Props johnjamesjacoby.
    Fixes #38810.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44804 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Feb 19, 2019
  1. Taxonomy: Remove `@ignore` annotation on `_get_term_hierarchy()`.

    boonebgorges committed Feb 19, 2019
    Originally introduced in [32453], the `@ignore` annotation caused the
    function to be improperly ignored by the Code Reference parser.
    
    The `@access private` annotation is the correct way to mark a
    function for internal use only.
    
    Props coffee2code.
    Fixes #45997.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44755 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Jan 9, 2019
  1. Taxonomy: Update `@SInCE` annotations for `meta_box_sanitize_cb` arg.

    boonebgorges committed Jan 9, 2019
    Introduced in [42211].
    
    Fixes #36514.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44519 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Jan 8, 2019
  1. Query: Standardize treatment of 'orderby' values `post__in`, `post_pa…

    boonebgorges committed Jan 8, 2019
    …rent__in`, and `post_name__in`.
    
    Ordering by `post__in` was introduced in [21776], but the code assumed that
    `post__in` would be a comma-separated string listing post IDs. When an array
    of post IDs was passed to the `post__in` query var, 'orderby=post__in' was
    not respected. This changeset changes this behavior by handling
    'orderby=post__in' in the same way as most other values of 'orderby',
    which ensures that arrays as well as strings can be properly parsed.
    
    The same treatment is given to the similar `post_name__in` and
    `post_parent__in` options of 'orderby', so that most query generation for
    orderby clauses happens in the same place, instead of in special cases.
    
    A slight change in the resulting SQL (related to the whitespace around
    parentheses and commas) necessitates a change to an existing REST API test
    that does a string comparison against the SQL query.
    
    Props mgibbs189, kelvink.
    Fixes #38034.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44452 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Dec 28, 2018
  1. Update `since` annotation for `wp_insert_term_duplicate_check` filter.

    boonebgorges committed Dec 28, 2018
    Originally added in [43570].
    
    Props audrasjb.
    Fixes #43271.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44372 602fd350-edb4-49c9-b593-d223f7449a82
  2. Update `since` annotation on `allow_empty_comment` hook.

    boonebgorges committed Dec 28, 2018
    Originally introduced in [42661].
    
    Fixes #16979.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44364 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Dec 19, 2018
  1. Ensure that taxonomy name passed to `get_term()` filters is non-empty.

    boonebgorges committed Dec 19, 2018
    Since [34997], the `$taxonomy` parameter of `get_term()` has been
    optional. This created cases where the `$taxonomy` parameter, used
    to concatenate names for some filters and passed as a parameter to
    others, would be empty. This changeset ensures that it's never
    empty by falling back on the `taxonomy` of the located term.
    
    Props dlh.
    Fixes #45698.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44325 602fd350-edb4-49c9-b593-d223f7449a82
  2. Update `@SInCE` tag on taxonomy hooks to be introduced in 5.1.0.

    boonebgorges committed Dec 19, 2018
    The hooks were added in [43558] but pulled from the 4.9.x and 5.0.x series.
    
    Fixes #44733.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@44321 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Aug 15, 2018
  1. Introduce `wp_insert_term_duplicate_term_check` filter.

    boonebgorges committed Aug 15, 2018
    This filter allows plugins to intervene in the duplicate-term check
    that takes place at the time of term creation. See [30238], #22023.
    
    Props strategio.
    Fixes #43271.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@43570 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Aug 8, 2018
  1. Correct param documentation for `WP_Term_Query`.

    boonebgorges committed Aug 8, 2018
    The description of `$meta_type` introduced in [40053] was incorrect.
    
    Props dlh.
    Fixes #44608.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@43559 602fd350-edb4-49c9-b593-d223f7449a82
  2. Taxonomy: Introduce new hooks when registering/unregistering taxonomi…

    boonebgorges committed Aug 8, 2018
    …es for object types.
    
    Props soulseekah.
    Fixes #44733.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@43558 602fd350-edb4-49c9-b593-d223f7449a82
Commits on May 25, 2018
  1. Taxonomy: Improve cache handling when querying for terms using `all_w…

    boonebgorges committed May 25, 2018
    …ith_object_id`.
    
    When a term query using `fields=all_with_object_id` hits the cache, the
    cached `stdClass` objects must be converted to `WP_Term` objects. This
    was overlooked when `WP_Term_Query` was refactored to support object
    queries in [38667].
    
    Props dlh.
    Fixes #44221.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@43313 602fd350-edb4-49c9-b593-d223f7449a82
Commits on May 23, 2018
  1. Taxonomy: Fix `$object_ids` reference in `WP_Term_Query` parameter do…

    boonebgorges committed May 23, 2018
    …cumentation.
    
    Props dlh.
    Fixes #44200.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@43308 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Apr 30, 2018
  1. Taxonomy: Ensure that invalid term objects are discarded in `WP_Term_…

    boonebgorges committed Apr 30, 2018
    …Query`.
    
    The `get_term()` mapping may result in term objects that are `null` or
    `WP_Error` when plugins use `get_term` or a related filter. Since `null`
    and error objects are not valid results for a term query, we discard
    them.
    
    Props GM_Alex.
    See #42691.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@43049 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Mar 1, 2018
  1. Allow `LIKE` queries against the 'key' value in meta queries.

    boonebgorges committed Mar 1, 2018
    The new `compare_key=LIKE` parameter works in conjunction with `key` in a
    similar way to the `compare=LIKE` and `value`: by doing a "compares" `LIKE`
    query. This allows developers to do partial matches against keys when
    doing meta queries.
    
    Props mariovalney, chasewg.
    Fixes #42409.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42768 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Feb 7, 2018
  1. Improve parameter description for 'allow_empty_comments'.

    boonebgorges committed Feb 7, 2018
    Introduced in [42661].
    
    Props swissspidy.
    See #16979.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42662 602fd350-edb4-49c9-b593-d223f7449a82
  2. Comments: Introduce 'allow_empty_comment' filter.

    boonebgorges committed Feb 7, 2018
    This filter allows plugin authors to allow empty comments on a selective
    basis during comment submission.
    
    Props jpurdy647.
    Fixes #16979.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42661 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Dec 22, 2017
  1. Taxonomy: Restore deprecated argument to `term_description()` signature.

    boonebgorges committed Dec 22, 2017
    This ensures that the parameter can't be reused for something else
    in the future.
    
    Props jorbin.
    Fixes #42605.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42417 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Dec 15, 2017
  1. Improve performance of `wp_list_pages()` tests.

    boonebgorges committed Dec 15, 2017
    The changeset also removes the use of hardcoded post/author IDs.
    
    Props frank-klein.
    Fixes #42903.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42402 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Dec 4, 2017
  1. `category_description()` should be taxonomy-agnostic.

    boonebgorges committed Dec 4, 2017
    This change reinstates the previous de facto behavior of `category_description()`.
    See [40979], [42364]. Because `term_description()` no longer passes `$taxonomy` to
    `get_term_field()`, the parameter is no longer needed and has been deprecated.
    
    Fixes #42605. See #42771.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42368 602fd350-edb4-49c9-b593-d223f7449a82
  2. `get_the_category_by_ID()` should be taxonomy-agnostic.

    boonebgorges committed Dec 4, 2017
    Prior to 4.9, this function was accidentally taxonomy-agnostic in most cases.
    The fix in [40979] caused a regression in this function. For backward
    compatibility, we make it explicit that the query is by ID only.
    
    See #42771.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42367 602fd350-edb4-49c9-b593-d223f7449a82
  3. Fix regression in `get_tag_link()` since 4.9.

    boonebgorges committed Dec 4, 2017
    See [42364] for description of the problem.
    
    Because `get_category_link()` is now totally taxonomy-agnostic, `get_tag_link()`
    can become a simple wrapper.
    
    Props juiiee8487, markjaquith.
    See #42771.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42366 602fd350-edb4-49c9-b593-d223f7449a82
  4. Fix incorrect test names from [42364].

    boonebgorges committed Dec 4, 2017
    See #42771.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42365 602fd350-edb4-49c9-b593-d223f7449a82
  5. Don't do a strict taxonomy check in `get_category_link()`.

    boonebgorges committed Dec 4, 2017
    Prior to version 4.9, a quirk in the implementation of `get_term()` caused
    `get_category_link( 123 )` to fetch the taxonomy archive link for term 123
    even if 123 is not in the 'category' taxonomy. The quirk was fixed in [40979];
    see #40671. This bugfix introduced a regression for theme authors who were
    expecting the old behavior.
    
    By lifting the 'category' restriction, we allow the template function to work
    in the old way.
    
    Fixes #42717. See #42771.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42364 602fd350-edb4-49c9-b593-d223f7449a82
Commits on Nov 21, 2017
  1. Introduce `meta_box_sanitize_cb` taxonomy argument.

    boonebgorges committed Nov 21, 2017
    The `meta_box_cb` argument was introduced in [25572] to allow plugin
    authors to provide a custom callback for rendering their taxonomy's meta
    box on the post edit screen. However, the routine used to handle the saving
    of these custom taxonomy meta boxes was not customizable, but was instead
    based simply on whether the taxonomy was hierarchicaly. See [13535].
    
    The new `meta_box_sanitize_cb` argument defaults to the "tag" routine for
    non-hierarchical taxonomies and the "category" routine for hierarchical ones,
    thereby maintaining the current default behavior. Developers can override this
    when the data passed from their `meta_box_cb` differs.
    
    Props boonebgorges, ZaneMatthew, stephenharris.
    Fixes #36514.
    
    git-svn-id: https://develop.svn.wordpress.org/trunk@42211 602fd350-edb4-49c9-b593-d223f7449a82
Older
You can’t perform that action at this time.