Plugin: Relative URL to images in another folder accessed inside a JS file

For this purpose you can use wp_localize_cript() function, like this: function localize_my_script() { $image_url = plugins_url( ‘resources/images/myimage.png’, __FILE__ ); $localizations = array( ‘imageURL’ => $image_url ); wp_localize_script( ‘my-script-handle’, ‘localizedVars’, $localizations ); } add_action( ‘wp_enqueue_scripts’, ‘localize_my_script’ ); That is assuming that you have properly enqueued your script with my-script-handle handle as an example.

why creating tables using $wpdb is not being executed while installing plugins?

Try using a different method. WordPress fires a hook during plugin activation activate_yourplugin/filename.php. You can use this to create tables. function creating_order_tables() { if(!get_option(‘tables_created’, false)) { global $wpdb; $ptbd_table_name = $wpdb->prefix . ‘printtextbd_order’; if ($wpdb->get_var(“SHOW TABLES LIKE ‘”. $ptbd_table_name .”‘” ) != $ptbd_table_name ) { $sql=”CREATE TABLE exone( customer_id INT(20) AUTO_INCREMENT, customer_name VARCHAR(255), order_type VARCHAR(255), … Read more

remove custom taxonomy metabox form custom post type

Change your taxonomy registration parameter show_ui to false… register_taxonomy(‘package_hotel’,’package’,array( ‘hierarchical’ => false, ‘labels’ => $Package_labels, ‘show_ui’ => false, ‘update_count_callback’ => ‘_update_post_term_count’, ‘query_var’ => true, ‘show_in_nav_menus’ => false, ‘rewrite’ => array( ‘slug’ => ‘hotels’ ), ));