Put the following line before using the function.
require_once( ABSPATH . '/wp-admin/includes/image.php' );
Related Posts:
- Creating a table in the admin-style?
- Change admin language based on user (in single-site)
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Admin config screen without menu
- Make Categories and Tags required in admin
- function triggered by “manage_users_custom_column” filter not working
- How to add HTML / Form to an Admin Bar Menu
- WordPress plugin how to run function when button is clicked
- Shortcodes, output buffering, and WordPress functions
- How can i list current author’s categories?
- Error with Custom Admin Screen in iframe Thickbox
- WP_Error handles errors, but how can I show success with a message?
- When to check if a function exists
- Dynamically Override Fancy Title
- Problem with `wp_mail()`
- Calling a function from functions.php in custom page/ blog post
- What is the Difference between directly call a function and call a function using add_action?
- Call to undefined function get_blog_option()
- JS / JQuery form validation in backend admin menus
- How to put placeholder text in the main post input area?
- What is the difference between current_page_parent and current_page_ancestor?
- Plugin development: is adding empty index.php files necessary?
- Undefined function wp_set_password
- What does $_registered_pages do?
- Add tab to profile.php wordpress plugin development
- WordPress Ajax callback function from plugin – OOP
- How can I add a CSS rule to edit.php?
- wp_enqueue_script + wp_enqueue_style Since When
- Admin auto-refresh is interfering with Firebug — how to prevent it?
- Widget update function not saving values
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- WordPress after content Hook & external template part
- override pluggable.php functions
- Can I change header.php of current theme through a plugin function?
- maintaing consistent layout wordpress dashboard
- get_current_screen() return null
- Add column and post filter for a custom post type field on the edit.php page
- creating custom function to log actions in plugin
- Is there no admin ui guide for 4.x?
- Maximum lifetime for nonce
- Where can i find wordpress auto update code flows?
- Correct check for any admin page with editor
- Adding option to Gallery shortcode
- Admin Plugin POST to another file within the plugin
- How to change the hover content of a specific menu item on WordPress?
- How do I update a field of a meta box?
- Admin – Handle data before creating or updating a post, page or custom post
- How can I replace content in the WP Admin area before an admin page is rendered?
- mysql_real_escape_string() vs. esc_sql() in WordPress
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Checking for existence of a page by title?
- how to get context information inside my funcion
- WordPress class, using add_action to call member function does not work
- How to Move the Comments Bubble to the Right Side of the Toolbar
- Does admin_print_scripts-$hook_suffix work for nested paths to individual files?
- wp_get_theme Warning: Illegal offset type
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Print Dashboard submenu name and filename
- Autogenerate a Table of Contents
- WordPress multisite,use same cookies across all website?
- Call to undefined function is_home() or any conditional tags
- wp_schedule_event is registered but function isn’t running
- Disable Auto-Expanding Menu in WordPress Admin Menus
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Remove Permalink Meta Box not working?
- Proper way to create an administration page without adding it to the menu
- Setting post_id for single.php based on URL without a redirect
- Javascript Function Called Too Early in PHP Script
- WP 3-way voting system: On to something! Please help!
- Custom Settings Plugin Save foreach checkboxes
- Change the behaviour of a button
- Add two button to page and post admin to redirect to : add new & list of (posts – pages) just after saving post or page
- Make visible page only in the trash
- Redirection from a specific page for users logged in but not with membership
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- WordPress Ajax not returning Response
- Remove tag from all posts when publishing new post
- How to create plugin settings page for each admin user?
- wp_ajax add_action fuction won’t fire on custom jQuery action
- foreach argument to get specific file types getting too many returns
- Remove from a div by class name from post page if post author role is not administrator
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- How to return a blank page
- Ajax not working to insert, query and result data
- Adding admin for specific users
- How do I control the list of Pages an author can see?
- Template file structure , wordpress hook for altering the template
- WordPress permalink setting
- How can I see a varibles value when my plugin runs?
- How can I add recent posts to menu like mashable
- Why is ‘register_activation_hook’ undefined?
- Dynamic banner for use on external sites
- How can i call from custom fields to the category editor?
- loop and in admin header problem
- Custom options page for themes
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- Call do_action() within WordPress cronjob
- How to plugin function code move to theme function.php ? I’ve tried below code but not working [closed]
- WordPress simple ‘Hello World’ plugin – problems