seanpaulfx
Forum Replies Created
-
Forum: Plugins
In reply to: [WP REST Cache] Custom endpointThanks it worked
Forum: Plugins
In reply to: [WP REST Cache] Custom endpointThe code seems to work, but how do I add two versions of api.
I add this code but it doesn’t work.
If I remove this fragment the code works.strpos( $uri, 'example1/v2/stype' ) === false ) { return $object_type; }
function wprc_determine_object_type( $object_type, $cache_key, $data, $uri ) { if ( $object_type !== 'unknown' || strpos( $uri, 'example1/v2/spost' ) === false || strpos( $uri, 'example1/v2/stype' ) === false ) { return $object_type; } return 'products'; } add_filter( 'wp_rest_cache/determine_object_type', 'wprc_determine_object_type', 10, 4 );
Thanks
Forum: Plugins
In reply to: [WP REST Cache] Custom endpointHere is my code
public function api_route_example1(){ register_rest_route('example1/v2','/spost/(?P<id>\d+)/(?P<page>\d+)',array( 'methods' => WP_REST_Server::READABLE, 'callback' => array($this,'api_action_example1'), 'permission_callback' => '__return_true', )); }
here is my code, added ‘spost’
Do I need to edit anything further?And what do I need to do with this object type filter.
function wprc_determine_object_type( $object_type, $cache_key, $data, $uri ) { if ( $object_type !== 'unknown' || strpos( $uri, $this->namespace . '/' . $this->rest_base ) === false ) { return $object_type; } // Do your magic here $object_type = 'website'; // Do your magic here return $object_type; } add_filter( 'wp_rest_cache/determine_object_type', 'wprc_determine_object_type', 10, 4 );
Thanks
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Search & FilterThank you!, it worked
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Search & FilterThe code above doesn’t seem to work, the results are returned as the default search.
This is my database image.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Search & FilterI am using a custom table instead of using a custom field. I found no other way to replace post__in.
Can you make an example for this filter?. i am using this code to get list of post ids.
function query_rating() { global $wpdb; $post_rating = $wpdb->get_results("SELECT id, rating FROM " . $wpdb->prefix . "blog" ); $rating = array_column($post_rating, 'rating'); array_multisort($rating, SORT_DESC, $post_rating); $srating = array_column($post_rating, 'id'); return $srating; }
I’m still quite confused as to how I should use the filter.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Search & FilterThanks for your help
The above problem is solved, but when I add the argument to $args in the code below, it seems to just return the default results.$args['post__in'] = $rating; $args['orderby'] = 'post__in';
It doesn’t seem to work with post__in.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Custom TableThank you!, it worked
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Custom TableI found the problem
add_filter( ‘relevanssi_index_content’, ‘__return_false’ );
Since I used this filter before, an error occurred.
I don’t want to index the post content, is there any way I can index the titles in a custom table.
Forum: Plugins
In reply to: [Imsanity] Image size errorWorks perfectly
Is there a way to customize the upload function size of the ACF plugin?
Thank you
Forum: Plugins
In reply to: [Custom Related Posts] Change post orderI mean I want to arrange the order according to my preference as shown below, I have quite a lot of links to related articles so I have to add manually for each article by section.
In the ACF plugin there is the section Relationship, You can drag and drop to change the order of posts.
Hope you can add this feature.
Forum: Plugins
In reply to: [WPSiteSync for Content] Could not sync taxonomyI have tried to contact through the contact section of the website but have not received any response in the last few days. The support is too bad.
- This reply was modified 4 years, 4 months ago by seanpaulfx.
- This reply was modified 4 years, 4 months ago by seanpaulfx.
Forum: Plugins
In reply to: [WPSiteSync for Content] Could not sync taxonomyI cannot pay with my paypal balance, only pay with a visa card? How do I pay with my paypal balance?
My card is in problem so I cannot pay via card.Forum: Plugins
In reply to: [WPSiteSync for Content] Could not sync taxonomyThe last question, can I use for multiple websites? or just 1 as default.
Forum: Plugins
In reply to: [WPSiteSync for Content] Could not sync taxonomyHello, I want additional functions, which plugin do I need to buy?
Taxonomy, Auto-Sync, Auto Publish
thanks