The functions below can be used to get a list of all Gravity Forms whose fields have a specific CSS class: View the code on Gist. Calling the first function looks like get_gravity_forms_with_css_class( ‘list-users2’ ) and the results it returns look like this: The keys of the array include the form ID and title. Each […]

Read more

WordPress’ get_super_admins() function can be used to get the logins for all the users on the current site. Its return value is in array that looks like: [ ‘maryann123’, ‘johnsmith456’, ‘annie-mcarthur’ ]. If you want WP_User objects for each of those users though, you can use get_users() function and pass in get_super_admins() as the ‘login__in‘ argument, like this: View […]

Read more

The function below can be used for getting the WP_Term object for the term that’s currently being edited on the term.php page in the WordPress admin. Just make sure that when you call this, the global $taxnow variable has been set. Using WP’s admin_init hook, or anything that fires after that point will work. View the code […]

Read more

WordPress doesn’t store a last modified date for navigation menus, so I created the set of functions below for keeping track of when menus were last updated. Whenever a menu is created or updated, a timestamp will be saved for it. You can then get the date modified timestamp for any menu using wds_get_menu_modified_timestamp( $menu_id ). […]

Read more

To transfer WordPress.org plugin ownership to someone else: Update the plugin’s readme.txt file, changing the Author, Author URI and Contributors in the plugin header and commit those changes to the SVN repository. Log in to wordpress.org and navigate to your plugin’s page. Click the “Advanced View” link in the right sidebar. From here, add and […]

Read more

The following function can be used to get the absolute path to the WordPress uploads directory: View the code on Gist. It will return a path to where the WordPress /uploads/ directory is, whether it’s in the default location or whether an UPLOADS constant has been defined to specify an alternate location. The path it returns will look […]

Read more