Custom global variable not working in function

I try to use this code and for the if statments I had to put a global $query_obj before the code, I do not know if is the case. global $query_obj; if ( is_a($query_obj, ‘WP_Term’) ) { $my_base_url = get_term_link($query_obj); } elseif ( is_a($query_obj, ‘WP_Post’) ) { $my_base_url = get_permalink(); } else { $my_base_url = … Read more

Variable inside shortcode or shortcode inside shortcode

apparently I found the solution (thanks to amatorpl), if anyone needs it: function show_history() { $user = wp_get_current_user(); $user_email = $user->user_email; $show_history = ‘[shortcode_name search=”‘.$user_email.'” show=”url, color, size”]’; $history = do_shortcode($show_history); return $history; } add_shortcode(‘show_history’, ‘show_history’); Thanks for the try

RTrouble passing arguments to action

You have an action hook named use_colors_here and you run the hook using do_action( ‘use_colors_here’, $data ), but I don’t see where you call add_action() for that hook? I mean, the do_action() and add_action() should be used like so: // This adds a callback to the use_colors_here hook. add_action( ‘use_colors_here’, ‘some_function’ ); // And this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)