You appear to be a bot. Output may be restricted
Description
Starting with a list of $items we create a new list that combines the current items and the matched items Do we need to do this as OO code. Should it be a separate classs, or an interface?
Here we add the filters that we want to use then perform the matching for each post returned The results are used to create a new list of posts
Usage
OIK_Clone_List_Table::match_posts();
Parameters
Returns
void
Source
File name: oik-clone/admin/class-oik-clone-list-table.php
Lines:
1 to 45 of 45
function match_posts() { oik_require( "admin/oik-clone-match.php", "oik-clone" ); oik_clone_match_filters(); $posts = $this->items; $new_items = array(); foreach ( $posts as $key => $data ) { $data->matched = "source"; $data->source = $data->ID; // $data->target = $data->ID; $new_items[] = $data; bw_trace2( $data ); $ID = $data->ID; // This is the match by 'magic' logic which needs to be replaced by the official code $new_item = clone $data; // get an array of matched posts // now append them to the new_items list // // $matched_posts = oik_clone_match_post( $ID, $data ); //if ( $matched_posts ) { // $posts[$key]["matched_posts"] = $matched_posts; /* $new_item->ID = 1; $new_item->source = $ID; // $new_item->target = 1; // this should be the ID of the matched post $new_item->matched = "magic"; $new_items[] = $new_item; */ $matched_items = $this->match_post( $data ); if ( count( $matched_items ) ) { foreach ( $matched_items as $new_item ) { $new_items[] = $new_item; } } } $this->items = $new_items; bw_trace2( $new_items ); }