There’s not enough information to really determine what is happening, but the best course of action is to make sure your code is only added to the options page, so it can’t interfere with anything on the edit page. You can use get_current_screen
for that, like this:
add_action( 'current_screen', 'wpse113256_this_screen' );
function wpse113256_this_screen() {
$current_screen = get_current_screen();
if( $current_screen ->id === "options" ) {
// Run your code
}
}
You’ll have to check if the ID of your options page is actually “options”.
Related Posts:
- How to force Media manager to overwrite files of same name?
- How can I stop WP media uploader from creating duplicates of my uploaded images?
- Get attachments by user
- wp_enqueue_script being ignored in custom theme
- Getting jquery to work with custom theme
- Including Javascript options
- Media Uploader in custom path
- Difficulty loading jQuery with wp_enqueue_script
- jQuery not available to other scripts
- wp.media issue with selected image
- how can i remove js file from my footer in wordpress
- WordPress uploads do not show up and I see the white screen of death in some cases
- enqueue script if page is not equal to
- Theme now uses require.js and enqueue script no longer works
- Convert base64 string to WordPress attachment uploads multiple images instead of a single one
- ajaxurl not defined on front end
- How to include jQuery and JavaScript files correctly?
- pass object/JSON to wp_localize_script
- How to enqueue script if widget is displayed on page?
- Get url of thumbnail from the media uploader
- Import media to online WordPress from local development
- How to get attachment id as soon as it is uploaded through media uploader in jquery?
- Why I can’t add a CSS style in this WordPress theme?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- jQuery in header or footer
- Is there a way to set the order of wp_footer hooked functions?
- How to alter the text of the post “Excerpt” box label in WordPress post editor?
- What can I hook into after_setup_theme?
- What does “Do not deregister the jquery script in the administration area” mean?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- How do you enqueue script tags for ReactDOM in WordPress’ functions.php?
- WordPress Enqueue Script Chaos (jQuery & Foundation.js)
- Can I add an icon & function to the “Upload/Insert” toolbar at the top of the content editor?
- Javascipt issue on custom theme
- zip unzip attachments in wordpress
- Overide enqueue in non plugable function via child theme
- How to make javascript work on theme options page
- How to register and enqueue JavaScript files without breaking plugin dependencies?
- JQuery undefined and Stylesheet loads in bottom along with js files
- Weirdness in jQuery supplied with WordPress
- Is it possible to determine when user is at “Media > Add New” vs “Post > Add an Image”
- How to fix : Uncaught ArgumentCountError: Too few arguments to function? [closed]
- How to enqueue a script which is type module without using script_loader_tag filter?
- How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?
- Using function from enqueued .js file in theme in plugin?
- jQuery from parent theme loaded with many other scripts in a single min.js file
- Custom jquery not code not working in wordpress
- WordPress creating images if uploaded image is greater than 960px on one side?
- Callback Function Not Firing On Selection In Media Uploader
- Using the media library for theme customization
- Trouble in enquing all js files under certain directory
- add jquery file if a certain page is included
- How do I implement jPanelMenu?
- HTTP Error when uploading images over specific dimensions
- loading javascript after jquery is loaded
- MapPress Easy Google Map in Jquery Tabs Problem
- I don’t think WordPress is loading jquery or bootstrap js
- Adding google fonts to WordPress theme
- How to locate the js code and php code for certain function?
- “The REST API did not process the context query parameter correctly.” Custom theme conflicting with Media Library
- How to properly use AWS SES for a contact form?
- wordpress file upload from direct directory not working
- Bootstrap slider not working
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Embedding CodePen Calorie Script – jquery error
- How to load jQuery with Ajax in WP version 5.3.2?
- How to enqueue scripts properly with ES6 webpack?
- WordPress core jquery version file not loaded?
- Infinite scroll without plugin using ajax
- change background image on scroll
- Enqueue script for development purposes only?
- How to make the media library searchable by image title
- Correct was to customise theme using get_theme_mod in scripts
- How to destroy or dispose wordpress uploder/manager?
- how to add jquery to wordpress
- Can’t upload images on new theme
- how can I re-utilize and class on a child theme
- How to install jquery dotdotdot plugin for WordPress?
- jQuery conflict in WordPress, works fine in HTML
- How would I get this to work – send to post from thick box
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- FitVid not working for iframes on particular theme install
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- WordPress custom jquery not found
- Passing a location-dependent array via wp_localize_script within a shortcode
- Set start page depending on screen width [closed]
- WordPress Subpages Fancybox Trouble
- Edit Image/Image Details – Replace button missing
- Enqueue script/style with multiple GET parameters
- can’t add EVENT LISTENER to a element
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- jQuery Snippet Not Working on WordPress Site [closed]
- WP Customizer get control value on change
- Execute javscript when theme customizer loads (autosave issue)
- Is there any halfway decent documentation on the wp.media JS class?
- WordPress Includes mejs 404 error
- Selective styles and scripts inclusion
- WordPress Media Uploader not displaying image that has just been uploaded
- How to Use Webpack with WordPress Script Modules and Enqueue a Custom Class
- How to save WordPress post and attachment images from front end using media library?