Halloween Sale 15% off Ends in See the plans

Snippet Library

Developer snippets for WordPress

Snippets for developers: debugging helpers, custom cron schedules, body classes, REST API tweaks and admin tools for checking hooks and queries. Building blocks for people who write code for WordPress every day.

1–9 of 9 snippets “print”

  • PHP Developer

    Add a Custom WP-CLI Command

    Registers a "wp site-stats" WP-CLI command that prints counts of posts, pages, comments and users, as a template for your own command-line tools.

  • PHP Developer

    Export Every Public URL (WP-CLI)

    Adds a "wp list-urls" command that prints the address of every published post, page, custom post and term archive, ready to build a redirect map before a migration or redesign.

  • PHP Developer

    Inspect the Main Query and Its SQL

    Lets administrators add ?wpide_query=1 to a front-end URL to print the main query's variables, the SQL it ran and the number of posts found at the bottom of the page.

  • PHP Developer

    Register Extra Menu Locations

    Adds new menu locations, such as a footer menu and a legal links menu, that you can assign under Appearance > Menus and print with wp_nav_menu() in a classic theme.

  • PHP Developer

    Searchable Options Viewer Under Tools

    Adds a Tools > Options Viewer screen where administrators can search the options table by name and see each value decoded and pretty-printed, including serialized arrays that Settings > All hides.

  • PHP Developer

    Show Which Functions Run on a Hook

    Lets administrators add ?wpide_hook=the_content (or any hook name) to a URL and see the callbacks attached to that hook with their priorities and source files, printed at the bottom of the page.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.