TheCosmonaut
Forum Replies Created
-
Forum: Plugins
In reply to: [Enjoy Social Feed plugin for WordPress website] 403 Error on images?Does that mean that the free version doesn’t work anymore?
Forum: Plugins
In reply to: [SimpleMap Store Locator] simplemap location categoriesDid you ever find a fix for this? I’m getting the same behavior on one site while it’s working perfectly on another (with pretty much the exact same setup)
Forum: Plugins
In reply to: [WooCommerce Bulk Discount] Add more than 5 discount lines?I’m also in adding new lines. Fine with modifying the raw plugin code — would just love some pointers where to start.
Forum: Plugins
In reply to: [JSON API] JSON output working only for logged in usersInteresting additional info: The JSON api works when the user has EDITOR level permissions, but nothing below.
Forum: Fixing WordPress
In reply to: Users having default values inserted, changes not savedFound the issue — had a plugin that was pulling references to a custom post type inside the admin area. The plugin was using a global $post value, which was overriding the main query in the admin area, so values from the other page were sneaking into this page.
Got rid of the global $post, fixed the issue.
You
Are
AWESOMEForum: Fixing WordPress
In reply to: Inserting Posts via External ScriptI’m requiring:
require('from/your/template/folder/path/to/wp-blog-header.php');
Which in my case (because I keep my PHP in a subfolder) is:
require('../../../../wp-blog-header.php');
Forum: Fixing WordPress
In reply to: Inserting Posts via External ScriptYou’re definitely not the only guy — I’m doing it on one of my projects now. This is the code I’m using and it’s working fine (it’s doing a “post” post_type and I’m using variables to designate author, title, and category):
//-- Set up post values $myPost = array( 'post_status' => 'publish', 'post_type' => 'post', 'post_author' => $authorID, 'post_title' => $title, 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_category' => array($category), ); //-- Create the new post $newPostID = wp_insert_post($myPost);
Given that our two sets of scripts are extremely similar, my next guess would be that the author_id is invalid and maybe that’s somehow preventing the page from being added. Maybe try testing with an actual author ID?
Forum: Themes and Templates
In reply to: How to prevent duplicate posts with wp_insert_post on single.phpThe really strange this is that I restarted my FF4 in Safe Mode (all add-ons off) and I’m still getting the duplication!
Forum: Themes and Templates
In reply to: How to prevent duplicate posts with wp_insert_post on single.phpOK – confirmed. This “double-loading” behavior only happens on MY copy of Mac Firefox 4.0 — tested on FF4 on another computer, as well as Safari & Chrome and only one post happens. My only guess is that one of my extensions is somehow causing it to fire twice (don’t have any idea which one; has anybody experienced anything similar to this using Firefox?).
What a relief — I thought I was going insane.
Forum: Themes and Templates
In reply to: How to prevent duplicate posts with wp_insert_post on single.phpOK – now something REALLY weird:
If I test the above code on Mac FF4.0, I get TWO posts.
If I test the above code on Mac Safari 5.0 and Chrome 11.0, I get ONE post.WTF?!
Forum: Themes and Templates
In reply to: How to prevent duplicate posts with wp_insert_post on single.phpI should mention also that I have no plugins activated…
Forum: Themes and Templates
In reply to: How to prevent duplicate posts with wp_insert_post on single.phpThanks for the reply! Unfortunately it looks like whatever is causing it to fire twice is not in the single.php page. This is the entire code I’m using on my test page:
<?php get_header(); ?> <?php $postTest = 0; echo '<p>LOAD: $postTest='.$postTest.'</p>'; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php //-- Set up post values $myPost = array( 'post_status' => 'publish', 'post_type' => 'post', 'post_author' => 2, // should be this post's Author 'post_title' => 'e3i8ir', 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_category' => array(24), // should be the NEXT category ); echo '<p>BEFORE: $postTest='.$postTest.'</p>'; //test //-- Create the new post $newPostID = wp_insert_post($myPost); $postTest++; echo '<p>AFTER: $postTest='.$postTest.'</p>'; //test ?> <?php endwhile; else: ?> <?php endif; ?> <?php get_footer(); ?>
Output is:
<p>LOAD: $postTest=0</p> <p>BEFORE: $postTest=0</p><p>AFTER: $postTest=1</p>
No duplication ??
Any ideas what could cause this function to fire twice?
Thanks,
–eric
Forum: Fixing WordPress
In reply to: Inserting Posts via External ScriptSince you’re not defining ‘post_status’, it might be creating a draft… did you check the admin area?
You can also try using ‘post_content’ instead of ‘post_content_filtered’…
Forum: Fixing WordPress
In reply to: Menu Admin Page BrokenI’m getting a similar thing – menus admin page loads incompletely. Did you find a cause/solution? Anyone else running into this?