s1ngular1ty
Forum Replies Created
-
Forum: Plugins
In reply to: Hook for when user logs into admin area.Sorry wrong forum, i think. Ill repost this in hacks. Feel free to delete
Forum: Themes and Templates
In reply to: Photum Theme, Photo Display ProblemI noticed that you managed to get it working vichitrachin
Forum: Themes and Templates
In reply to: Photum Theme, Photo Display ProblemDid you manage to resolve this? I’m having the same issue.
Forum: Hacks
In reply to: meta_box problem. Update works on some posts but not others!Having played around with this issue a litte more it seems my problem lies with this section of code:
$vclLockedContent = $_POST['vclLockedContent']; //lockedcontent if (get_post_meta($post_id, 'vclLockedContent', TRUE) != ''){ update_post_meta($post_id, 'vclLockedContent',$vclLockedContent); } else{ add_post_meta($post_id, 'vclLockedContent', $vclLockedContent); }
It seems that when I remove all content from my wp_editor box and save it, it means it no longer does an update_post_meta() but always tries to add_post_meta() instead. At least that is my diagnosis.
Can anyone suggest a better way of writing this if statement? I need a way of determing whether to do an add_post_meta or an update_post_meta.
Forum: Hacks
In reply to: Using arguments with add_action and do_actionThanks for trying to help me esmi, I really appreciate it. But could you tell me how to pass arguments to the function given in the following statement.
add_action(‘wp_head’,’vclAddtoHead’,10,2);
The variables are just strings. I have simplified my code in the above examples, for ease of reading.
The reason I thought I needed a do_action was due to the following link:
https://www.ads-software.com/support/topic/passing-arguments-to-add_action?replies=8
If ANYONE can tell me how to pass arguments with add_action I will be v gratefull.
Forum: Hacks
In reply to: Using arguments with add_action and do_actionOK let me take a step back.
I have defined my function vclAddtoHead as to take two arguments:
function vclAddtoHead($arg1,$arg2){
echo $arg1;
echo $arg2;
}I want this function to echo the arguments in the head tags. So thought I needed a function as follows:
add_action(‘wp_head’,’vclAddtoHead’);
But I need at some point to actually give my two arguments to my function. So how do I do this? I thought I had to modify add_action so that it specifies that my function takes two arguments, as follows:
add_action(‘wp_head’,’vclAddtoHead’,10,2);
Am I correct so far?
If so what, now? Where do I actually specify what my two arguments are?
In short how do I pass arguments to a function used in an add_action?