jankowski
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Update Page ButtonFixed with
wp_set_current_user()
Forum: Hacks
In reply to: Manual update of postFixed with
wp_set_current_user()
Forum: Fixing WordPress
In reply to: Update Page ButtonOkay, thanks! Yeah, he’s been okay about getting back to me but hasn’t responded lately.
Thank you for your help!
Forum: Fixing WordPress
In reply to: Update Page ButtonSo if I’m using
wp_insert_post
already in my code, I should try to find where, in the plugin source code, the author usesadd_action('save_post, etc. etc.)
and try to use that function?Forum: Fixing WordPress
In reply to: Update Page ButtonThanks, tried
wp_update_post
, didn’t work quite as I had hoped. To be a bit more specific about my problem, I’m manually creating a page using a PHP command line script, and I’m trying to have certain privacy settings from the plugin User Access Manager be applied to that page. With just my script, the settings are not properly applied. However, when I go onto the WordPress editor on my site and simply click the “Update Page” button for the page without doing anything else, the settings suddenly activate. I’m sure there’s some function within the plugin source code that would help, but it’s quite an extensive set of files, and I’m just trying to have the page update itself from the PHP script as a bit of a shortcut. When I triedwp_update_post()
in different parts of the script, nothing new happened.Do you know if any other functions are called when the button is clicked? (Thank you for the response!)
Forum: Hacks
In reply to: Manual update of postI’m not necessarily looking to create separate settings or more options for the dashboard itself; I’m just trying to work around a certain plugin’s peculiarities and essentially to refresh/update a post immediately after it’s been created using
wp_insert_post()
. Do you know if there’s a particular function for the existing “Update” button that I can use in my code (without creating new tabs on the dashboard, etc.)?Forum: Hacks
In reply to: Manual update of postI haven’t looked at that yet! None of my searching on Google/WordPress took me to that page.
Forum: Plugins
In reply to: [User Access Manager] Add manually created post to private group?Problem resolved:
$my_post = array( 'ID' => /*given id*/, 'post_title' => /*title*/, 'post_content' => /*content*/, 'post_status' => 'publish', 'post_type' => 'page', 'comment_status'=> 'closed' ); // Insert the post into the database $postId = wp_insert_post( $my_post ); $groupId = /*ID of desired group*/; $con = mysqli_connect("example.com", "username", "password", "wordpress"); mysqli_query($con, "INSERT INTO /*database path*/uam_accessgroup_to_object (object_id, object_type, group_id) VALUES ($postId, 'page', $groupId)"); mysqli_close($con);
Thanks for your help, Alex!
Forum: Plugins
In reply to: [User Access Manager] Add manually created post to private group?Anybody have any input on the matter? I tried doing a MySQL query using WordPress’s format, but my database didn’t like the syntax.
Forum: Plugins
In reply to: [User Access Manager] Delete [L] after each Page Title ?