- Create a .gitignore file in the git repository if it does not contain one
touch .gitignore
2. Open up the .gitignore and add the following line to the file
node_modules 3. Remove the node_modules folder from the git repository
| <?php | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| use Illuminate\Support\Facades\File; | |
| class extractTranslationStrings extends Command | |
| { |
| So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
| Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
| * Off the top of my head * | |
| 1. Fork their repo on Github | |
| 2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
| git remote add my-fork [email protected] |
| <?php | |
| require dirname(__FILE__).'/wp-blog-header.php'; | |
| $wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')"); | |
| $wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'"); | |
| $wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)"); | |
| $wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
| $wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
| $wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')"); |
| <?php | |
| // GET FEATURED IMAGE | |
| function ST4_get_featured_image($post_ID) { | |
| $post_thumbnail_id = get_post_thumbnail_id($post_ID); | |
| if ($post_thumbnail_id) { | |
| $post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id, 'featured_preview'); | |
| return $post_thumbnail_img[0]; | |
| } | |
| } |
| add_action( 'init', 'handle_preflight' ); | |
| function handle_preflight() { | |
| header("Access-Control-Allow-Origin: " . get_http_origin()); | |
| header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE"); | |
| header("Access-Control-Allow-Credentials: true"); | |
| if ( 'OPTIONS' == $_SERVER['REQUEST_METHOD'] ) { | |
| status_header(200); | |
| exit(); |
| <? | |
| $yourTaxonomySlugHere = get_the_terms($post->ID, 'yourTaxonomySlugHere'); | |
| if ($terms) : | |
| foreach ($terms as $term) : | |
| echo $term->name; | |
| endforeach; | |
| endif; | |
| ?> |