brad3260
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: External form submission data lostI figured out that if I did my processing in the init action, I had access to the POST variables
- This reply was modified 6 years, 4 months ago by brad3260.
Forum: Developing with WordPress
In reply to: set cookie won’t workWell, turns out my code was working, I had an SQL issue. Sorry about that but thank you everybody for the assistance!
Forum: Developing with WordPress
In reply to: set cookie won’t workThank you everyone for the suggestions, I’m still unable to get it to work so I’m thinking I am going to try javascript. I know I would need a js function that looks something like the following
function setcookie(accid) { //code }However, how would I get the values from my PHP into the function call?
Forum: Developing with WordPress
In reply to: set cookie won’t workNo echo or print statements or any lines that send anything to the browser
Forum: Developing with WordPress
In reply to: set cookie won’t workWhat do you mean by external domain? I’m setting the cookie for the same domain that the code is running. I’ve even tried omitting the domain and path.
Forum: Developing with WordPress
In reply to: insert categoryYou guys rock! That works, thank you so much for the help!
Forum: Developing with WordPress
In reply to: insert categoryProblem with that is, the category would be added every time a page is loaded. I was to give the user a couple of default categories that they can keep, edit or delete if they want. I’m starting to think the easiest way to do this is to have a “first time activated” flag that once the plugin is activated, the flag gets set to false. Then in have the plugin check that flag, if true, insert categories, and if false, don’t. I was just trying not to have that if statement run every time, seems like a waste.
Forum: Developing with WordPress
In reply to: insert categoryI was mistaken, I am getting both e-mails but the category is not being added.
Forum: Developing with WordPress
In reply to: insert categoryAh that makes sense. I have the following code.
function bbradley_rfp_activation() { $my_cat = array('cat_ID' => 0, 'cat_name' => 'My Category', 'category_description' => 'A Cool Category', 'category_nicename' => 'category-slug', 'taxonomy' => 'Services'); $bbt = wp_insert_category($my_cat); mail($myemail, 'sub', 'post fired'); } register_activation_hook( __FILE__, 'bbradley_rfp_activation_pre'); function bbradley_rfp_activation_pre() { add_action('activated_plugin', 'bbradley_rfp_activation'); mail($myemail, 'sub', 'pre fired'); }I get the “pre fired” e-mail but I don’t get the “post fired” e-mail so it seems the “activated_plugin”action is not getting triggered?
Forum: Developing with WordPress
In reply to: insert categoryHello, thank you for the suggestion. Unfortunately there is very little documentation to this action so I’m hoping you can help me a little more. I replaced the register_activation_hook line with
do_action('activated_plugin', array(__FILE__, 'bbradley_rfp_activation'));
but the function doesn’t get triggered?Forum: Developing with WordPress
In reply to: insert categoryIt is but it’s not working, any ideas why?