WHERE meta_key = '_us_in_content_ids' AND ({$meta_value_like}) "; // Iterate queries us_iterate_queries( $query, function ( $items ) use ( &$used_in, $ids, $posts_types ) { foreach ( $items as $item ) { if ( ! $post_id = $item->post_id ) { continue; } $meta_value_ids = explode( ',', $item->meta_value ); foreach ( $ids as $id ) { if ( in_array( $id, $meta_value_ids ) AND us_is_post_visible_for_curr_lang( $post_id, $id ) ) { $used_in[ $id ]['singulars_content'][ $post_id ] = array( 'url' => us_get_edit_post_link( $post_id ), 'edit_url' => us_get_edit_post_link( $post_id, $item->post_type ), 'title' => empty( $item->post_title ) ? us_translate( '(no title)' ) : $item->post_title, 'post_type' => ! empty( $posts_types[ $id ] ) ? $posts_types[ $id ] : NULL, ); } } } } ); // Append locations to result string foreach ( $ids as $id ) { if ( ! empty( $used_in[ $id ] ) AND ! empty( $used_in[ $id ]['singulars_content'] ) ) { foreach ( $used_in[ $id ]['singulars_content'] as $location ) { switch ( $location['post_type'] ) { case 'us_page_block': $url = $location['edit_url']; $title = __( 'Edit Reusable Block', 'us' ); break; case 'us_content_template': $url = $location['edit_url']; $title = __( 'Edit Page Template', 'us' ); break; default: $url = $location['url']; $title = us_translate( 'View Page' ); break; } $link_atts = array( 'href' => $url, 'target' => '_blank', 'title' => $title, ); $results[ $id ] .= '
' . $location['title'] . '
'; } } } // Widgets (for Grid Layouts only) $regexp_layouts = array(); foreach ( $ids as $id ) { $regexp_layouts[] = strlen( $id ) . ':"' . $id; } $regexp_layouts = implode( '|', $regexp_layouts ); $query = " SELECT `option_name`, `option_value` FROM {$wpdb->options} WHERE option_name LIKE 'widget%' AND option_value REGEXP '\"layout\";s:({$regexp_layouts})\"' LIMIT 0, 100"; if ( $widget_options = $wpdb->get_results( $query ) ) { global $wp_registered_sidebars, $wp_registered_widgets; $_widget_titles = $_sidebars_widgets = array(); // Get widget_id => Sidebar name foreach ( wp_get_sidebars_widgets() as $sidebar_id => $widget_ids ) { if ( $sidebar_id === 'wp_inactive_widgets' OR ! isset( $wp_registered_sidebars[ $sidebar_id ] ) ) { continue; } $_sidebars_widgets = array_merge( $_sidebars_widgets, array_fill_keys( array_values( $widget_ids ), $wp_registered_sidebars[ $sidebar_id ]['name'] ) ); } // Get widget name foreach ( $wp_registered_widgets as $base_id => $widget ) { foreach ( $widget['callback'] as $callback ) { if ( isset( $callback->option_name, $_sidebars_widgets[ $base_id ] ) ) { $number = substr( $base_id, mb_strlen( $callback->id_base . '-' ) ); $_widget_titles[ $callback->option_name ][ $number ] = [ 'sidebar_name' => $_sidebars_widgets[ $base_id ], 'name' => $callback->name, ]; } } } unset( $_sidebars_widgets ); // Creating links for widgets foreach ( $widget_options as $usage_result ) { foreach ( $ids as $id ) { foreach ( unserialize( $usage_result->option_value ) as $number => $value ) { if ( ! is_array( $value ) OR ! isset( $value['layout'] ) OR $value['layout'] != $id ) { continue; } $_widget = isset( $_widget_titles[ $usage_result->option_name ][ $number ] ) ? $_widget_titles[ $usage_result->option_name ][ $number ] : []; $name = isset( $_widget['name'] ) ? $_widget['name'] : ''; if ( ! empty( $value['title'] ) ) { $name .= ': ' . $value['title']; } $sidebar_name = isset( $_widget['sidebar_name'] ) ? $_widget['sidebar_name'] . ' > ' : ''; // NOTE: The widget is in the config because it is not deleted, you can find it on // the widgets page in the "Inactive Sidebar (not used)" action, but we do not display this. if ( empty( $sidebar_name ) ) { continue; } $results[ $id ] .= '
' . esc_html( $sidebar_name ); $results[ $id ] .= '' . esc_html( $name ) . ''; $results[ $id ] .= '
'; unset( $_widget, $name, $sidebar_name ); } } } } $group_posts_types = array(); foreach ( $posts_types as $id => $post_type ) { $group_posts_types[ $post_type ][] = $id; } /** * Layouts for archives or taxonomies * * Note: Despite the fact that here the foreach receipt of data * occurs for one type of post (the current one) */ foreach( array( 'us_header', 'us_content_template', 'us_page_block' ) as $us_post_type ) { if ( ! empty( $group_posts_types[ $us_post_type ] ) ) { // Keys from the archives or taxonomy page $usage_meta_keys = array( // Header 'us_header' => array( 'archive_header_id' => __( 'Archives Layout', 'us' ), 'pages_header_id' => __( 'Pages Layout', 'us' ), ), // Page Templates 'us_content_template' => array( 'archive_content_id' => __( 'Archives Layout', 'us' ), 'pages_content_id' => __( 'Pages Layout', 'us' ), ), // Footer 'us_page_block' => array( 'archive_footer_id' => __( 'Archives Layout', 'us' ), 'pages_footer_id' => __( 'Pages Layout', 'us' ), ), ); $query = " SELECT tm.term_id, t.name, tt.taxonomy, tm.meta_key, tm.meta_value FROM {$wpdb->termmeta} AS tm LEFT JOIN {$wpdb->terms} AS t ON tm.term_id = t.term_id LEFT JOIN {$wpdb->term_taxonomy} AS tt ON tm.term_id = tt.term_id WHERE tm.meta_value IN( '" . implode( "','", $group_posts_types[ $us_post_type ] ) . "' ) AND tm.meta_key IN( '" . implode( "','", array_keys( $usage_meta_keys[ $us_post_type ] ) ) . "' ) "; // Iterate queries us_iterate_queries( $query, function ( $items ) use ( &$results, $group_posts_types, $usage_meta_keys, $us_post_type ) { foreach ( $items as $item ) { foreach ( $group_posts_types[ $us_post_type ] as $id ) { if ( in_array( $id, explode( ',', $item->meta_value ) ) AND $tax = get_taxonomy( $item->taxonomy ) ) { $result = '
' . $tax->label . ' > '; $result .= $item->name . ' > '; $result .= us_translate( $usage_meta_keys[ $us_post_type ][ $item->meta_key ] ) . ''; $result .= ' (' . us_translate( 'Edit' ) . ')
'; $results[ $id ] .= $result; } } } } ); } } // Menus (nav_menu_item) for Reusable Blocks only if ( ! empty( $group_posts_types['us_page_block'] ) ) { $meta_value_like = ''; foreach ( $group_posts_types['us_page_block'] as $id ) { if ( ! empty( $meta_value_like ) ) { $meta_value_like .= ' OR'; } $meta_value_like .= " meta1.meta_value LIKE '%" . $id . "%'"; } $query = " SELECT meta1.meta_value, p.ID as post_id FROM {$wpdb->postmeta} meta1 LEFT JOIN {$wpdb->postmeta} meta2 ON ( meta1.post_id = meta2.post_id AND meta2.meta_key = '_menu_item_object' AND meta2.meta_value = 'us_page_block' ) LEFT JOIN {$wpdb->posts} AS p ON meta1.post_id = p.ID WHERE meta1.meta_key = '_menu_item_object_id' AND ({$meta_value_like}) "; // Iterate queries us_iterate_queries( $query, function ( $items ) use ( &$used_in, $ids ) { foreach ( $items as $item ) { if ( ! $post_id = $item->post_id ) { continue; } $meta_value_ids = explode( ',', $item->meta_value ); foreach ( $ids as $id ) { if ( ! in_array( $id, $meta_value_ids ) ) { continue; } $used_in[ $id ]['nav_menu_item'][ $post_id ] = wp_get_post_terms( $post_id, 'nav_menu', array( 'fields' => 'all' ) ); } } } ); } // Append locations to result string foreach ( $ids as $id ) { if ( ! empty( $used_in[ $id ] ) AND ! empty( $used_in[ $id ]['nav_menu_item'] ) ) { foreach ( $used_in[ $id ]['nav_menu_item'] as $location ) { if ( ! empty( $location ) ) { $link_atts = array( 'href' => admin_url( 'nav-menus.php?action=edit&menu=' . $location[0]->term_id ), 'target' => '_blank', 'title' => us_translate( 'Edit Menu' ), ); $results[ $id ] .= '
' . us_translate( 'Menus' ) . ' > ' . $location[0]->name . '
'; } } } } // Return "No results" message if set foreach ( $results as &$result ) { if ( empty( $result ) AND $show_no_results ) { $result = us_translate( 'No results found.' ); } } } return $results; } /** * Generate locations names where used specific element * * @param int $post_ID * @param bool $show_no_results * @return string */ function us_get_used_in_locations( $post_ID, $show_no_results = FALSE ) { $results = (array) us_get_all_used_in_locations( array( $post_ID ), $show_no_results ); return ! empty( $results[ $post_ID ] ) ? $results[ $post_ID ] : ''; } } l1 6-11-2018 Reinier Wijland IMG_0068 - Rijschool Ans

Autorijschool Ans stopt met het geven van autorijlessen.

Fiat punto spiegel - Ans

Ik wil iedereen bedanken die rijlessen heeft gevolgd bij Autorijschool Ans.

Ans – Rijinstructeur