jon424
Forum Replies Created
Viewing 5 replies - 1 through 5 (of 5 total)
-
Forum: Fixing WordPress
In reply to: Trying to get Desktop Menu on Mobile Viewthanks, will do.
Forum: Fixing WordPress
In reply to: Trying to get Desktop Menu on Mobile ViewActually 🙂 I’m working with Astra theme, and the starter templates plugin that i am using is Plant Shop.
Forum: Fixing WordPress
In reply to: Trying to get Desktop Menu on Mobile ViewI am working with the Plant Shop theme
Forum: Plugins
In reply to: [WooCommerce] cannot add product – GUI warped on screennevermind – i was able to drag and drop those menus back over to the center… 🙂
- This reply was modified 3 years, 11 months ago by jon424.
Forum: Developing with WordPress
In reply to: wp_register_script / wp_enqueue_script errorsThanks for the feedback. I fixed this issue by wrapping everything inside an add_action hook:
add_action('wp_enqueue_scripts', function(){ //1. get User Status $user_id = get_current_user_id(); $user_output = get_user_meta($user_id, 'needs_extra_item', true); //echo $user_output[0]; //2. Register the script wp_register_script( 'some_handle', './js/jqueryLaPuerta.js' ); //3. Localize the script with new data $some_array = array( 'some_string' => __( $user_output, 'plugin-domain' ), 'a_value' => '10' ); wp_localize_script( 'some_handle', 'object_name', $some_array ); //4. Enqueued script with localized data. wp_enqueue_script( 'some_handle' ); });
Viewing 5 replies - 1 through 5 (of 5 total)