israel wissotzky
Forum Replies Created
Viewing 7 replies - 1 through 7 (of 7 total)
-
Forum: Plugins
In reply to: [Admin Columns] Filtering problemI made a few more games this is my code
function cf_search_join( $join ) { global $wpdb; // ????? ??? ?? ????? ?? Admin Columns if (!is_admin_columns_filter() || !is_acf_filter()) { if ( is_search() ) { $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' AS prefix_pm ON ' . $wpdb->posts . '.ID = prefix_pm.post_id '; } } return $join; } add_filter('posts_join', 'cf_search_join' ); function cf_search_where( $where ) { global $pagenow, $wpdb; // ????? ??? ?? ????? ?? Admin Columns if (!is_admin_columns_filter() || !is_acf_filter()) { if ( is_search() ) { $where = preg_replace( "/\(\s*".$wpdb->posts.".post_title\s+LIKE\s*(\'[^\']+\')\s*\)/", "(".$wpdb->posts.".post_title LIKE $1) OR (prefix_pm.meta_value LIKE $1)", $where ); } } return $where; } add_filter( 'posts_where', 'cf_search_where' ); function is_admin_columns_filter() { $filters = array( 'cpac/filter/columns', 'cpac/filter/terms', ); return in_array(current_filter(), $filters); } function is_acf_filter() { if (current_filter() === 'acf/load_field') { $field = func_get_arg(0); if ($field['key'] === 'field_5fda152076292') { return true; } } return false; }
And it works great
Forum: Plugins
In reply to: [Admin Columns] Filtering problemI installed it is the error it raises
Not unique table/alias: ‘fcm_postmeta’
Forum: Plugins
In reply to: [Admin Columns] Filtering problemYes I checked it does the problem
I changed this code but it doesn’t help it only happens in the ACF fieldfunction cf_search_join( $join ) { global $wpdb; // ????? ??? ?? ????? ?? Admin Columns if (!is_admin_columns_filter() || !is_acf_filter()) { if ( is_search() ) { $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id '; } } return $join; } add_filter('posts_join', 'cf_search_join' ); function cf_search_where( $where ) { global $pagenow, $wpdb; // ????? ??? ?? ????? ?? Admin Columns if (!is_admin_columns_filter() || !is_acf_filter()) { if ( is_search() ) { $where = preg_replace( "/\(\s*".$wpdb->posts.".post_title\s+LIKE\s*(\'[^\']+\')\s*\)/", "(".$wpdb->posts.".post_title LIKE $1) OR (".$wpdb->postmeta.".meta_value LIKE $1)", $where ); } } return $where; } add_filter( 'posts_where', 'cf_search_where' ); function is_admin_columns_filter() { $filters = array( 'cpac/filter/columns', 'cpac/filter/terms', ); return in_array(current_filter(), $filters); } function is_acf_filter() { if (current_filter() == 'acf/load_field') { $field = func_get_arg(0); if ($field['key'] == 'field_5fda152076292') { return true; } } return false; }
There may be another way to make the search search ACF fields as well
- This reply was modified 1 year, 5 months ago by israel wissotzky.
Forum: Plugins
In reply to: [Admin Columns] Filtering problemYes I have this code
function cf_search_join( $join ) { global $wpdb; if ( is_search() ) { $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id '; } return $join; } add_filter('posts_join', 'cf_search_join' ); function cf_search_where( $where ) { global $pagenow, $wpdb; if ( is_search() ) { $where = preg_replace( "/\(\s*".$wpdb->posts.".post_title\s+LIKE\s*(\'[^\']+\')\s*\)/", "(".$wpdb->posts.".post_title LIKE $1) OR (".$wpdb->postmeta.".meta_value LIKE $1)", $where ); } return $where; } add_filter( 'posts_where', 'cf_search_where' );
It helps me in searching in META FILDLS. Is there a better way to do it?
Forum: Plugins
In reply to: [Advanced Custom Fields: Extended] Information DiscosuerThank you very much it was really the Elementor Custom Skin plugin
I have another problem from the information security side
The user can inject HTML code into the ACF field
Forum: Plugins
In reply to: [Wordpress Hebrew Date] ????? ?????????
????? ?? ????? ??? ???? ???? ?? ???? ?? ????
??? ???? ?? ?? ?????? ?? ???
Forum: Plugins
In reply to: [Wordpress Hebrew Date] ????? ?????????? ??? ???? ?? ?? ???? ????? ???? ?? ????? ?
Viewing 7 replies - 1 through 7 (of 7 total)