Skip to content

Instantly share code, notes, and snippets.

@NickGreen
NickGreen / maps_tags.php
Last active September 22, 2020 22:47 — forked from tiagonoronha/maps_tags.php
MAPS add tags to posts - wrapped in CLI command
<?php
class MAPS_Tags extends WP_CLI_COMMAND {
function __invoke() {
$lines = file( dirname(__FILE__) . '/tags.csv', FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES );
foreach ( $lines as $line ) {
$line = str_getcsv( $line );