kfuchs
Forum Replies Created
-
Forum: Hacks
In reply to: Correct use of Roles and Capabilities with add_submenu_page()it’s unsupported and can stop working with any update.
Thank you, that explains it. I was just trying to understand why if it works is it considered incorrect.
Forum: Hacks
In reply to: Correct use of Roles and Capabilities with add_submenu_page()But you dont have to make it ‘administrator’ you can make it ‘subscriber’ or ‘editor’ so how does it make it insecure?
Also if that’s the case how do you give access to something for a subscriber but not an editor?
Forum: Hacks
In reply to: trouble using get_current_user_id()never mind, I added require_once(ABSPATH.’wp-includes/pluggable.php’); to the first line of my plugin and that worked.
This seems like a bug with wordpress tho.
Forum: Hacks
In reply to: Stupid problem with adim.php?page=Thanks for the help, I realized another way to do it. If anyone comes across googling this here is how I did it:
I use str_replace() to replace the ‘action=edit’ into ‘action=saved’
I create two arrays:
$to_replace = array('%7E','action=edit'); $replace_with = array('~','action=saved');then in my html form I use:
<form name="culis_edit_item_form" action="<?php echo str_replace( $to_replace, $replace_with, $_SERVER['REQUEST_URI']); ?>" method="post">Forum: Hacks
In reply to: Creating an edit page like the one for PostsI figured out how to solve it, however I do not fully understand how this works.
when you call wp_editor() it has to be within the function that you use to add_submenu_page()
IE:
<?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, submenu_page_function); ?>
<?php function submenu_page_function(){
wp_editor(‘<p>Some content</p>’, ‘editortest_one’ );
}?>I did not test but I am assuming it will work in all the
add_any_page()PS: this plugin helped me understand it.
Forum: Hacks
In reply to: Creating an edit page like the one for Poststried using it but I keep getting:
Call to undefined function wp_get_current_user() in …wordpress\wp-includes\user.php on line 258
Forum: Hacks
In reply to: Creating an edit page like the one for PostsOMG thank you so much… I googled for HOURS trying to figure it out.
All the info I encountered were out-dated and referenced functions that didn’t exist anymore ;(.
Forum: Hacks
In reply to: Creating an edit page like the one for PostsThat was useful but not for this question :). lol
I have added images to explain it better, here is what I mean, when I click the:
I want this:
With the proper name and description already in those fields.
Forum: Hacks
In reply to: Please help understanding why use this instead ofAnother example. This might be me being silly but why use:
function get_bulk_actions() { $actions = array( 'delete' => 'Delete' ); return $actions; }instead of:
function get_bulk_actions() { return $actions = array( 'delete' => 'Delete' ); }wouldn’t it be faster to process in case 2, even if it is minuscule?
or am I wrong and is there some purpose behind having it done the other way?
Forum: Meetups
In reply to: Meet- Up in Albany New YorkI’m in NYC so let me know if theres a meet-up here. Thanks
Forum: Fixing WordPress
In reply to: Submitting values from options page to a newly created tableok so I figured it out after following a google search but I really do not understand it at all…
I put in
action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>"but what the hell does that mean???
Yeh agreed. It would be really nice in order to have each user in a separate cat or sub-cat