Continue reading Using phrases in Related posts searches

Using phrases in Related posts searches

…look at that next: function rlv_process_terms( $post, $taxonomy, $process = ‘restrict_to_taxonomy’ ) { $terms = get_the_terms( $post, $taxonomy ); $term_names = array(); $callback = ‘rlv_phrasify_taxonomify’; if ( ‘just_add_phrases’ === $taxonomify ) { $callback = ‘rlv_phrasify’; } if ( $terms ) { $term_names = array_map( $callback, array_map( function( $term ) {……return $term->name; }, $terms ), array_fill( 0, count( $terms ), $taxonomy ) ); } return $term_names; } First, this function gets the terms for the current post in the taxonomy chosen. Then the terms are passed through a double-layered array_map() construction. The inner array_map() extracts the term names from the…terms (get_the_terms() returns full WP_Term objects, but we only care about the name) – it’s just a version of array_column() for objects, basically. The outer array_map() passes the terms through a callback function, depending on which behaviour is required. The default mode is restrict_to_taxonomy, which adds phrases and the taxonomy targeting,…

Read more Using phrases in Related posts searches 0 Comment on Using phrases in Related posts searches
Continue reading Premium 2.6 / Free 4.5

Premium 2.6 / Free 4.5

…automatic update. The download page shows two different versions of the plugin available. The basic version no longer includes tests or anything else you won’t need when actually using the plugin. The developer version includes tests and all sorts of other tooling you may find interesting if you’re a developer….

Read more Premium 2.6 / Free 4.5 5 Comments on Premium 2.6 / Free 4.5