Comments (3)
Without being able to see your code I can only guess that maybe your theme isn't enqueuing the script properly, especially if you just copied the code directly, it will only enqueue on the sample plugin's options page (line 36 in the sample plugin). Also, make sure you aren't trying to enqueue it from within the sample plugin - copy the entire icon-picker folder into your theme and point to it there. But again, just guessing since I can't see your code.
Multiple instances of the icon-picker are used in my ZappBar plugin. It might help you to look at the options page code for that. You may also want to take a look at how Plethora Themes integrated the icon-picker code to their theme framework (click the number next to "Fork" at the top to go to their repo).
from icon-picker.
Tnx for replay, sry yeah my mistake i didnt included most important part
the code. i didnt explained exactly what i wanted as well. I wanted to move
the code to another page. Your are using add_options_page hook but i used
add_theme_page
THE CODE:
// Make sure we only enqueue on our options page //
global $pagenow;
if ($pagenow=="options-general.php" && isset( $_GET['page'] ) &&
$_GET['page'] == 'maximus_settings' ) {
add_action( 'admin_enqueue_scripts', 'icon_picker_scripts' );
}
i didnt know that if you are loading it from theme page you have to change
the url , where are options are loaded, i didnt change the
options-general.php to themes.php first, that way it was not working but
now it is working like charm. just getting know little bit more WP setting
API. But anyway thanks for the great plugin. Makes my developing much
easier.
Cheers
from icon-picker.
You're welcome, glad it's useful to you and others. Happy coding!
from icon-picker.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icon-picker.