Help with adding fullcalendar.io to a WordPress page

Figured it out! First I passed what Iceable suggested and also added moment script above, like so wp_register_script(‘moment’, “https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js”); wp_register_script( ‘fullcalendar’, “https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.js”, array( ‘jquery’ ), null, true); and then I edited JS like so jQuery(function ($) { $(‘#calendar’).fullCalendar({ }) }); And it showed up!

How can I strip a single tag from an email post

The following regex should do the trick to select all instances of the videopack shortcode, including contents: \[videopack.*?\[\/videopack\] $post_description = preg_replace( ‘\[videopack.*?\[\/videopack\]’, ”, $post->post_content ); https://www.php.net/manual/en/function.preg-replace.php https://regexr.com/

Check if User Meta has Existing Value

If I understand correctly, you are wanting to prevent duplicate IDs in the meta data: use the get_user_meta() function to retrieve the meta value and check it for the ID (untested): $meta = get_user_meta( $user_id, ‘saved_session’ ); if ( ! in_array( $post_id, $meta ) ) { add_user_meta( $user_id, ‘saved_session’, $post_id ); } For others that … Read more

Add/Modify rel=canonical of all the pages of a wordpress website

You’ll want to prevent SEO plugins from adding a canonical meta tag, and then add your own canonical meta tag using wp_head filter (untested): add_action( ‘wp_head’, static function () { $url = trailingslashit( get_site_url() ); $url .= ltrim( $_SERVER[‘REQUEST_URI’], “https://wordpress.stackexchange.com/” ); printf( ‘<link ref=”canonical” href=”%s” />’, esc_attr( $url ) ); } );

wordpress media library description column

Use the nl2br() function (tested): function column_id_row( $columnName, $media_item ) { if ( ‘description’ !== $columnName ) { return; } $attachment_meta = get_post( $media_item ); echo nl2br( $attachment_meta->post_content ); } add_filter( ‘manage_media_custom_column’, ‘column_id_row’, 10, 2 );

How to get default variation ID (woocommerce)

Try this code add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2); function custom_variation_price( $price, $product ) { $available_variations = $product->get_available_variations(); $selectedPrice=””; $dump = ”; foreach ( $available_variations as $variation ) { // $dump = $dump . ‘<pre>’ . var_export($variation[‘attributes’], true) . ‘</pre>’; $isDefVariation=false; foreach($product->get_default_attributes() as $key=>$val){ // $dump = $dump . ‘<pre>’ . var_export($key, true) . ‘</pre>’; // $dump … Read more

File not found.