coleh3
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Timepicker In The CustomizerI fixed this by adding a sanitize function to the customizer element. This would format it properly upon saving.
function sanitize_programming_time( $time ) { return date( 'g:ia', strtotime( $time ) ); }Forum: Developing with WordPress
In reply to: REST API Post Categories & TagsThanks. After messing around with it a bit I found that the best way to actually do it with the least amount of calls is to try and create the category using the category name with a post request. If the post request returns an error that the category already exists it also returns the ID of the category that exists so I can simply just grab that. For categories that do get created I can then grab the newly created category ID.
This results in fewer calls as I don’t have to try and return each category with a get request first and then a post request for ones that don’t exist. I was using the ?search method before to see if the category existed by name but was resulting in more calls if one needed to be created.
I know I could also just make a request for all categories and run each category through the results seeing if it exists and set the ID if it does or make a post request if it doesn’t however that was alot more logic and the simple solution was the post request for each category.
Forum: Developing with WordPress
In reply to: REST API Post Categories & TagsI’ve gotten this done so far. The issue I guess I am trying to wrap my head around is what if a post contains 2 categories and the site that is trying to be posted to only contains 1 of the categories.
The below works if the categories are present and writing something to create the categories if the array returns empty with no id’s is easy. Just trying to get some ideas on how to make it work with the cases of mismatches where 1 category exists and maybe 1 doesn’t already.
// Get post from post id $post = (array)get_post( $post_id ); // Get categories from post id $categories = get_the_terms( $post_id, 'category' ); // If post has categories if ( $categories ) : // Make a request to retrieve all categories from targeted site $cat_url = 'http://url.com/wp-json/wp/v2/categories?per_page=100'; $cat_response = wp_remote_get( $cat_url ); $cat_response_body = wp_remote_retrieve_body( $cat_response ); $cat_decoded = json_decode( $cat_response_body, true ); // For each post category foreach ( $categories as $category ) : // For each item in the category API response foreach( $cat_decoded as $cat ) : // Check if the category exists already if ( $cat['name'] === $category->name ) : // Grab category ID and set it in array $cat_ids[] = $cat['id']; endif; endforeach; endif;Forum: Developing with WordPress
In reply to: Creating A Scheduled Featured Post SectionThank you for the response.
The issue is I want to create one UI space where the featured posts can be scheduled. This will take away from someone having to go through multiple post types to find posts to schedule in the featured area. It will also present a better way to see the overall picture of what’s scheduled and where it is. Unless there is an easy way to use one settings page to update and add post meta to the posts so that way it can be done from the post itself or from the one settings page.
Forum: Plugins
In reply to: [Redis Object Cache] Set All Options Appearing Alot In MonitorThanks. I was curious as I thought Redis would maybe only cache each individual options row separately and not the full options table at once.
Forum: Plugins
In reply to: [The Events Calendar] Issue w/ (Added an oEmbed template for events)I updated to the latest version and I am still having issues with the oEmbeds being replaced by a tribe_events post.
Wanted to let you know that it is still happening even with latest version.
Thank you for looking into this for me.
Forum: Plugins
In reply to: [WPeMatico RSS Feed Fetcher] RSS Feed With Query String Doesn't WorkI am getting an error when checking that feed still. It won’t let me get past saving the feed and tells me I should try to force feed. Not sure why yours is working.
Only security plugin I have is Wordfence at the moment.
Forum: Plugins
In reply to: [The Events Calendar] Issue w/ (Added an oEmbed template for events)I can also confirm that disabling the events calendar plugin on both a local and server environment fixed the issue with oEmbeds.
I wonder if this is due to an Oauth limit per google account?
We have around 100 websites using this plugin and if one person’s google account authorizes more than 25 of these websites, will that cause it to break when it reaches the limit?
After doing some investigating, I wonder if this may be the issue?
I checked the servers time settings and everything appears normal. It has a timezone set and is showing the proper date and hours.
Our websites are located in different timezones so the Google Analytics are set to those timezones in which the website resides. The WordPress timezones are also set properly.
What else could be causing the error posted above to happen every few days?
Hi Alin,
Where would I want to check this?
Our WordPress Timezones are set and our sites take place across multiple timezones and are set in Google Analytics to reflect this.
What exactly needs to be set and synced from server to GA?
Forum: Plugins
In reply to: [Force Login] Whitelist Reset Password LinkNevermind,
I figured it out.
I needed /recover-password/ instead of /recover-password
Forum: Plugins
In reply to: [Easy Custom Sidebars] Check If Custom Sidebar ExistsThanks Sunny. I went with the first option you provided that way the user as the control to easily take away the widget themselves but they don’t have to go through the hassle of setting up any of the widget settings for related posts to show.
I think it offers flexibility without complicating things.
I appreciate your help with this.
Forum: Plugins
In reply to: [Easy Custom Sidebars] Check If Custom Sidebar ExistsThat fixed the syntax error, however it doesn’t appear to want to output the get_yuzo_related_posts(); function.
I’m trying to mess with it a bit to see what could be the issue. It just doesn’t output anything at all on any page.
Thank you for helping me with this. I would really like to make this work some-how.
Forum: Plugins
In reply to: [Easy Custom Sidebars] Check If Custom Sidebar ExistsThanks Sunny.
I’m getting a parse error on this part:
$ecs_frontend = ECS_Frontend->get_instance();