Defining the value of a variable before a function?

Wrong approach. $print_submenu_navigation will be filled in local scope when function is called with arguments, it’s not a matter of global variables. You want something like this when function is called (not defined): load_view( ‘name’, array(), current_user_can(‘administrator’) ) { Alternatively you can add your snippet inside the function, then input value for $print_submenu_navigation will overwritten … Read more

Preventing Duplicating Posts from Widgets

You should use post__not_in parameter (see Post & Page Parameters in Codex). Since it takes an array you will also need to switch to array rather than string for passing arguments. Something like this: query_posts(array( ‘showposts’ => 1, ‘cat’ => get_catId( $instance[‘catOption4’] ), ‘post__not_in’ => $themename_do_not_duplicate, ));

get_term_by with a variable

you can look at line 874 in /wp-includes/taxonomy.php for the function itself. the value has stripslashes applied and then it’s used in a prepared statement, so I’d say it’s safe. but there’s nothing stopping you from checking the value yourself first if you know what parameters it will always fall within, like ctype_alnum or something. … Read more

SFTP define in wp-config.php

Do you mean SFTP or FTPS? For SFTP you need to enable libssh2-php on your server and link it to your PHP and restart your ssh, you can get the downloads here http://www.libssh2.org/ Once you install that you should automatically see SFTP/SSH option in your admin under “Connection”, though I believe there was some recent … Read more

PHP variables in a post?

By default, PHP is stripped out of the posts content. You can use this plugin to aleivate this: http://wordpress.org/extend/plugins/exec-php/ This will give you a quick, easy fix to be able to do it the way you are trying to. I would suggest reading http://codex.wordpress.org/Custom_Fields for the more proper way to do this though.

Loop info in jquery Tabs – loop into a variable?

You would have to perform the query for each respective tab. If you are using WP_Query then you can perform the query and then use $found_posts to return the total number of posts matching that query. For instance, $query_tab_1 = new WP_Query($args); //Where $args is some arguments for your query $tab_1_count = $query_tab_1->found_posts; The $query_tab_1 … Read more