This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| //Program by Kevin 'Hay1tsme' Trocolli | |
| //Uses Discord webhooks to push updates about a Challonge tournament to a discord server via text message | |
| const request = require('request'); | |
| const fs = require('fs'); | |
| const timer = require('timers') | |
| const hook = "<Discord Webhook Here>" | |
| const chal = "https://api.challonge.com/v1/tournaments/<subdomain>-<tournimentURL>/matches.json?api_key=<apiKey>&state=complete" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Update Post Title from an ACF field value on post save. | |
| * | |
| * Triggers on save, edit or update of published posts. | |
| * Works in "Quick Edit", but not bulk edit. | |
| */ | |
| function sync_acf_post_title($post_id, $post, $update) { | |
| $acf_title = get_field('my_acf_field_name', $post_id); // NOTE: enter the name of the ACF field here |
| Nome Articolo | Argomento | Tipologia |
|---|---|---|
| Moving to HTTPS Guide | https | guide |
| developer-roadmap | web | gist |
| How to Use CSS Animations Like a Pro | css | guide |
| Do responsive sites have to be so tall on mobile? | re |
Adding @k1sul1's suggestion from the comments as it's more concise than what I had before:
I just wanted them all gone, so I ran this in the MySQL shell.
UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, "\\[\/?vc(.*?)\]", "");
Note the double backslash. If you forget it, you'll replace all v's and c's with nothing, and the shortcodes will still be there. This works for other shortcode as well, just replace vc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // add the below to your functions file | |
| // then visit the page that you want to see | |
| // the enqueued scripts and stylesheets for | |
| function se_inspect_styles() { | |
| global $wp_styles; | |
| echo "<h2>Enqueued CSS Stylesheets</h2><ul>"; | |
| foreach( $wp_styles->queue as $handle ) : | |
| echo "<li>" . $handle . "</li>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*** Function to show images whether SVG or non SVG ***/ | |
| /*** $size & $attribute both can hold array if you want ***/ | |
| function show_image( $image_id, $size = null, $attributes = null ) { | |
| //first lets get the file info sto understand what kind of file it is | |
| //as for svg file we will take different approach | |
| $file_info = pathinfo( wp_get_attachment_url( $image_id ) ); | |
| //so, if the file type is SVG | |
| if ( $file_info['extension'] === 'svg' ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if ( get_field( 'field_name' ) ): ?> | |
| This is displayed when the field_name is TRUE or has a value. | |
| <?php else: // field_name returned false ?> | |
| This is displayed when the field is FALSE, NULL or the field does not exist. | |
| <?php endif; // end of if field_name logic ?> |