EkoJR
Forum Replies Created
-
I should of thought twice about posting that since I have a better method that I forgot about, but I do have a good lead now, and thank you for taking the time to provide some feedback. It definitively helps.
I would prefer providing you with more information, but I need a little more time to review what I have now, and I need to catch some sleep. Ran out of time for the night. I at least wanted to give you with some kind of update, and I’ll be posting more information later.
I’ve had a little bit of time to look into this issue a little further, and there’s one problem on my side. I’m having a difficult time trying to reproduce the issue. The sanitize_post function is triggered when there is ‘raw’ data found, and everything on my side keeps using proper data.
My guess right now is that what ever is being passed into that function doesn’t match up to WordPress’s configuration. This could be a post type, taxonomy, or page saved in the database, and this isn’t because of the APL Plugin necessarily, but I can create something to fall back on. Some other plugin’s also use post types in a different fashion, and if that’s the case, I could set it up to ignore it. Especially if it has no relation to the APL plugin’s purpose.
I’m unable to get my stuff to debug inside the function, and since you already have the event being triggered. Could you modify the function where the error is occurring? …and then post the results?
Old function
function sanitize_post($post, $context = 'display') { if ( is_object($post) ) { // Check if post already filtered for this context if ( isset($post->filter) && $context == $post->filter ) return $post; if ( !isset($post->ID) ) $post->ID = 0; foreach ( array_keys(get_object_vars($post)) as $field ) $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); $post->filter = $context; } else { // Check if post already filtered for this context if ( isset($post['filter']) && $context == $post['filter'] ) return $post; if ( !isset($post['ID']) ) $post['ID'] = 0; foreach ( array_keys($post) as $field ) $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); $post['filter'] = $context; } return $post; }
Modified function
function sanitize_post($post, $context = 'display') { if ( is_object($post) ) { // Check if post already filtered for this context if ( isset($post->filter) && $context == $post->filter ) return $post; if ( !isset($post->ID) ) $post->ID = 0; //Modify this foreach, add brackets and the echo line foreach ( array_keys(get_object_vars($post)) as $field ){ echo '$field = ' + $field + '\n$post->field = ' + $post->$field + '\n$post->ID = ' + $post->ID + '\n$context = ' + $context + '\n\n'; $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); } $post->filter = $context; } else { // Check if post already filtered for this context if ( isset($post['filter']) && $context == $post['filter'] ) return $post; if ( !isset($post['ID']) ) $post['ID'] = 0; foreach ( array_keys($post) as $field ) $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); $post['filter'] = $context; } return $post; }
Sorry for a late reply. A lot going on in the world today.
Thank you for the feedback. I believe it has something to do with CPT, and it may be awhile til I can provide a proper fix. So, for the time being, I would recommend using version 0.2.0. The only downside is that it doesn’t support CPT.
Sorry I can’t provide an ideal solution right now, but it is an issue that I’ll need time to investigate.
I’m still working on getting this figured out.
…but I do have a few questions.
Are you using a Custom Post Type and Taxonomies (CPT) plugin? If so, what is the plugin’s name?
Have you used multiple CPT plugins on the site in the past?Sorry thebeggs4 for this being an ongoing process just to get it figured out.
Yea, I was about to say, there is an ‘Include Terms’ function setting. I just wanted to make sure it fit the scenario.
Ok, now I’m a lil lost. Are you talking about calling the preset post list based on a category? Or using a single page/layout and displaying posts inside the preset post list, and it is determined by the current categories of that page?
The only solution, is to go through each post type and selected them.
Yea, I’ve thought about setting it up for that, but when coding it all up, I was mainly aiming to create a hierarchy with post types and taxonomies. Basically get the hard work done first and get it all fine tuned.
What I will do though. Inside the accordion that holds the post types, the first one will become ‘Any’ in a sense, and will hold all your taxonomies. It’s just that I wanted to get the hardest part of the plugin coded up first.
Thanks.
There is one thing about the post date settings. I gave it some thought to add it to beta-5, but decided not to since it would require further planning on how I would add the variable(s) to the option database, and it required further organization on how I was going to implement it for preset post list. The option is nice to supply to people, but it would require modification to the plugin’s database settings.
Which btw, is this a fix for Version 0.3.b5?
Thank you very much for posting this. Development on shortcodes is one of the things I have been planning to make the primary focus for on a later project, but right now I’m mainly working on getting everything corrected. Which btw, I think I’m going to start 0.3.Beta-6, and fix the backup feature…hopefully that will be the last beta.
Another thing I was trying to do was add an area to report bugs in WordPress Plugin Trac, but I guess that option isn’t available and they are even thinking about scrapping it. Tried Google Code, but their repository repeatedly had issues. GitHub is another option, and their layout is more what I was looking for, but now I’m wanting to stay away from outside sources. What I’m trying to say, stuff like this really needs an area, provided by WordPress in order to better support extensions, to report bugs, recommend enhancements, and questions regarding a particular task out of the plugin.
I may add my own section for it, but for the most part, everyone is stuck waiting on WP developers to add support for reporting issues. Anyways, just me rambling, but thanks again for posting a fix for this issue.
That’s completely understandable not wanting to provide urls in a public area, but in this case, I already know what the issue is that you are running into.
The exclude current page setting should be working fine, and it seems that’s not the case. The real issue lies with ‘exclude duplicates’, and there is a good reason why, especially in the manner that you are using it. The ‘exclude duplicates’ only pertains to the APL plugin.
Whenever the plugin is used, each time it gathers the posts that it is going to display for a preset post list, it will also store the post IDs in the class variable. So, from the time it is first used on a given page, the post list itself, has the option to exclude those post IDs that the APL plugin has already queried. Which means, any other function and/or plugin that is outside of the APL plugin, will not be stored in the class variable exclude list.
Creating your own WP loop creates a function that is outside the APL plugin, and isn’t added to the exclude list. The exclude functions probably could use some more enhancements like excluding post IDs by created post lists that you don’t want repeated, but for now I created a way to exclude any duplicates that may be created by the APL plugin on a given page.
I would be interested in how you are using the plugin though, and what tasks you are trying to accomplish. Kind of gives me some ideas from time to time for future enhancements, but I guess that would be up to you if you want to share.
Oh ok, I thought you were talking about something with WordPress. Well, it’s definitely appreciated when others show their support, and I’m pretty sure I speak for other development authors that it’s a big motivational factor.
Actually, I should be the one saying ‘thank you’. It really does help seeing good comments, but being considered for a donation do speak louder than words. So, truly, thank you for your consideration and generosity. Hope you enjoy further progress with the plugin in the days to come. =)
Forum: Plugins
In reply to: [Advanced Post List] [Plugin: Advanced Post List] Private Posts Not ListingSince 0.3, this has been added and supported.
I fixed some issues with script registering which could of prevented clients from receiving data properly from Google’s CDA. Possibly creating a timeout error. Since then I have switch over to WordPress platform’s built in scripts.
FYI, I have another database upgrade in 0.3.Beta5 (as well as 0.3.Alpha1). So make sure you backup your data first because I currently don’t support downgrading versions (or downgrade update for the database).