diff --git a/.gitignore b/.gitignore index d17a9d4..dd1d2c8 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,4 @@ wp-content/debug.log # add a line here that looks like this: # !/wp-content/themes/currentorg !/wp-content/themes/currentorg +!/wp-content/plugins/current-ltw-projects diff --git a/wp-content/plugins/current-ltw-projects/.distignore b/wp-content/plugins/current-ltw-projects/.distignore new file mode 100755 index 0000000..a2c3490 --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/.distignore @@ -0,0 +1,41 @@ +# A set of files you probably don't want in your WordPress.org distribution +.babelrc +.deployignore +.distignore +.editorconfig +.eslintignore +.eslintrc +.git +.gitignore +.gitlab-ci.yml +.travis.yml +.DS_Store +Thumbs.db +behat.yml +bitbucket-pipelines.yml +bin +.circleci/config.yml +composer.json +composer.lock +dependencies.yml +Gruntfile.js +package.json +package-lock.json +phpunit.xml +phpunit.xml.dist +multisite.xml +multisite.xml.dist +.phpcs.xml +phpcs.xml +.phpcs.xml.dist +phpcs.xml.dist +README.md +webpack.config.js +wp-cli.local.yml +yarn.lock +tests +vendor +node_modules +*.sql +*.tar.gz +*.zip diff --git a/wp-content/plugins/current-ltw-projects/.editorconfig b/wp-content/plugins/current-ltw-projects/.editorconfig new file mode 100755 index 0000000..79207a4 --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/.editorconfig @@ -0,0 +1,22 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# https://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +indent_size = 4 + +[{.jshintrc,*.json,*.yml}] +indent_style = space +indent_size = 2 + +[{*.txt,wp-config-sample.php}] +end_of_line = crlf diff --git a/wp-content/plugins/current-ltw-projects/.gitignore b/wp-content/plugins/current-ltw-projects/.gitignore new file mode 100755 index 0000000..9181160 --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +phpcs.xml +phpunit.xml +Thumbs.db +wp-cli.local.yml +package-lock.json +node_modules/ +*.sql +*.tar.gz +*.zip diff --git a/wp-content/plugins/current-ltw-projects/Gruntfile.js b/wp-content/plugins/current-ltw-projects/Gruntfile.js new file mode 100755 index 0000000..5c3390f --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/Gruntfile.js @@ -0,0 +1,56 @@ +module.exports = function( grunt ) { + + 'use strict'; + + // Project configuration + grunt.initConfig( { + + pkg: grunt.file.readJSON( 'package.json' ), + + addtextdomain: { + options: { + textdomain: 'current-ltw-projects', + }, + update_all_domains: { + options: { + updateDomains: true + }, + src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ] + } + }, + + wp_readme_to_markdown: { + your_target: { + files: { + 'README.md': 'readme.txt' + } + }, + }, + + makepot: { + target: { + options: { + domainPath: '/languages', + exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ], + mainFile: 'current-ltw-projects.php', + potFilename: 'current-ltw-projects.pot', + potHeaders: { + poedit: true, + 'x-poedit-keywordslist': true + }, + type: 'wp-plugin', + updateTimestamp: true + } + } + }, + } ); + + grunt.loadNpmTasks( 'grunt-wp-i18n' ); + grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' ); + grunt.registerTask( 'default', [ 'i18n','readme' ] ); + grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] ); + grunt.registerTask( 'readme', ['wp_readme_to_markdown'] ); + + grunt.util.linefeed = '\n'; + +}; diff --git a/wp-content/plugins/current-ltw-projects/current-ltw-projects.php b/wp-content/plugins/current-ltw-projects/current-ltw-projects.php new file mode 100755 index 0000000..a258dfa --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/current-ltw-projects.php @@ -0,0 +1,25 @@ + array( + 'name' => __( 'Local That Works Projects', 'current-ltw-projects' ), + 'singular_name' => __( 'Project', 'current-ltw-projects' ), + 'all_items' => __( 'All LTW Projects', 'current-ltw-projects' ), + 'archives' => __( 'LTW Project Archives', 'current-ltw-projects' ), + 'attributes' => __( 'LTW Project Attributes', 'current-ltw-projects' ), + 'insert_into_item' => __( 'Insert into Project', 'current-ltw-projects' ), + 'uploaded_to_this_item' => __( 'Uploaded to this Project', 'current-ltw-projects' ), + 'featured_image' => _x( 'Project Featured Image', 'projects', 'current-ltw-projects' ), + 'set_featured_image' => _x( 'Set featured image', 'projects', 'current-ltw-projects' ), + 'remove_featured_image' => _x( 'Remove featured image', 'projects', 'current-ltw-projects' ), + 'use_featured_image' => _x( 'Use as featured image', 'projects', 'current-ltw-projects' ), + 'filter_items_list' => __( 'Filter Projects list', 'current-ltw-projects' ), + 'items_list_navigation' => __( 'Projects list navigation', 'current-ltw-projects' ), + 'items_list' => __( 'Projects list', 'current-ltw-projects' ), + 'new_item' => __( 'New Project', 'current-ltw-projects' ), + 'add_new' => __( 'Add New', 'current-ltw-projects' ), + 'add_new_item' => __( 'Add New Project', 'current-ltw-projects' ), + 'edit_item' => __( 'Edit Project', 'current-ltw-projects' ), + 'view_item' => __( 'View Project', 'current-ltw-projects' ), + 'view_items' => __( 'View LTW Projects', 'current-ltw-projects' ), + 'search_items' => __( 'Search LTW Projects', 'current-ltw-projects' ), + 'not_found' => __( 'No Projects found', 'current-ltw-projects' ), + 'not_found_in_trash' => __( 'No Projects found in trash', 'current-ltw-projects' ), + 'parent_item_colon' => __( 'Parent Project:', 'current-ltw-projects' ), + 'menu_name' => __( 'Projects', 'current-ltw-projects' ), + ), + 'public' => true, + 'hierarchical' => false, + 'show_ui' => true, + 'show_in_nav_menus' => true, + 'supports' => array( 'title', 'editor' ), + 'has_archive' => true, + 'rewrite' => array( 'slug' => 'local-that-works' ), + 'query_var' => true, + 'menu_position' => null, + 'menu_icon' => 'dashicons-awards', + 'show_in_rest' => true, + 'rest_base' => 'projects', + 'rest_controller_class' => 'WP_REST_Posts_Controller', + 'supports' => array( + 'title', + 'editor', + // 'author', + 'thumbnail', + // 'excerpt', + 'custom-fields', + // 'comments', + // 'revisions', + // 'page-attributes', + // 'post-formats', + ), + ) ); + +} +add_action( 'init', 'projects_init' ); + +/** + * Sets the post updated messages for the `projects` post type. + * + * @param array $messages Post updated messages. + * @return array Messages for the `projects` post type. + */ +function projects_updated_messages( $messages ) { + global $post; + + $permalink = get_permalink( $post ); + + $messages['projects'] = array( + 0 => '', // Unused. Messages start at index 1. + /* translators: %s: post permalink */ + 1 => sprintf( __( 'Project updated. View Project', 'current-ltw-projects' ), esc_url( $permalink ) ), + 2 => __( 'Custom field updated.', 'current-ltw-projects' ), + 3 => __( 'Custom field deleted.', 'current-ltw-projects' ), + 4 => __( 'Project updated.', 'current-ltw-projects' ), + /* translators: %s: date and time of the revision */ + 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Project restored to revision from %s', 'current-ltw-projects' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, + /* translators: %s: post permalink */ + 6 => sprintf( __( 'Project published. View Project', 'current-ltw-projects' ), esc_url( $permalink ) ), + 7 => __( 'Project saved.', 'current-ltw-projects' ), + /* translators: %s: post permalink */ + 8 => sprintf( __( 'Project submitted. Preview Project', 'current-ltw-projects' ), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + /* translators: 1: Publish box date format, see https://secure.php.net/date 2: Post permalink */ + 9 => sprintf( __( 'Project scheduled for: %1$s. Preview Project', 'current-ltw-projects' ), + date_i18n( __( 'M j, Y @ G:i', 'current-ltw-projects' ), strtotime( $post->post_date ) ), esc_url( $permalink ) ), + /* translators: %s: post permalink */ + 10 => sprintf( __( 'Project draft updated. Preview Project', 'current-ltw-projects' ), esc_url( add_query_arg( 'preview', 'true', $permalink ) ) ), + ); + + return $messages; +} +add_filter( 'post_updated_messages', 'projects_updated_messages' ); + +/** + * Register the custom post meta for Local That Works projects + * + * @link https://developer.wordpress.org/reference/functions/register_meta/ + * @link https://developer.wordpress.org/block-editor/tutorials/plugin-sidebar-0/ + */ +function projects_register_post_meta() { + register_post_meta( + 'projects', + 'project-contact-name', + array( + 'object_subtype' => 'post', + 'type' => 'string', + 'description' => 'The contact human for this project.', + 'single' => true, + 'sanitize_callback' => 'sanitize_text_field', + // 'auth_callback' => .... I don't know the answer to this question. + 'show_in_rest' => true, + ) + ); + register_post_meta( + 'projects', + 'project-contact-email', + array( + 'object_subtype' => 'post', + 'type' => 'string', + 'description' => 'The contact email for this project.', + 'single' => true, + 'sanitize_callback' => 'sanitize_text_field', + // 'auth_callback' => .... I don't know the answer to this question. + 'show_in_rest' => true, + ) + ); + register_post_meta( + 'projects', + 'project-organization', + array( + 'object_subtype' => 'post', + 'type' => 'string', + 'description' => 'The organization responsible for this project.', + 'single' => true, + 'sanitize_callback' => 'sanitize_text_field', + // 'auth_callback' => .... I don't know the answer to this question. + 'show_in_rest' => true, + ) + ); + register_post_meta( + 'projects', + 'project-video', + array( + 'object_subtype' => 'post', + 'type' => 'string', + 'description' => 'Link to video URL for this project', + 'single' => true, + 'sanitize_callback' => 'esc_url_raw', + // 'auth_callback' => .... I don't know the answer to this question. + 'show_in_rest' => true, + ) + ); +} +add_action( 'init', 'projects_register_post_meta' ); + +/** + * Add the meta boxes for the projects meta fields + * + */ +function projects_add_meta_box() { + add_meta_box( + 'current-ltw-project', + __( 'Project Metadata', 'current-ltw-projects' ), + 'projects_meta_box', + 'projects', // post type + 'advanced', + 'high', + array( + '__block_editor_compatible_meta_box' => true, + '__back_compat_meta_box' => false, + ) + ); +} +add_action( 'add_meta_boxes', 'projects_add_meta_box' ); + +/* + * Save callback for the project meta fields + */ + + +/** + * The meta box for the project meta fields + */ +function projects_meta_box( $post ) { + // project-contact-name - text + // project-contact-email - email + // project-organization - text + // project-video - url +} diff --git a/wp-content/plugins/current-ltw-projects/readme.txt b/wp-content/plugins/current-ltw-projects/readme.txt new file mode 100755 index 0000000..1580b2c --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/readme.txt @@ -0,0 +1,42 @@ +=== Current.org Local That Works Projects === +Contributors: innlabs +Donate link: https://inn.org/donate +Tags: comments, spam +Requires at least: 4.5 +Tested up to: 5.4.1 +Stable tag: 0.1.0 +License: GPLv2 or later +License URI: https://www.gnu.org/licenses/gpl-2.0.html + +Creates the 'projects' post type powering the Local That Works database + +== Description == + +This plugin: +- creates the "Projects" post type for the Local That Works database +- registers the taxonomies that power that database +- registers the post metadata fields used in that database + +== Installation == + +This plugin is already installed on your site. If it becomes uninstalled, redownload it from https://github.com/INN/umbrella-currentorg/tree/master/wp-content/plugins + +== Frequently Asked Questions == + += A question that someone might have = + +An answer to that question. + += What about foo bar? = + +Answer to foo bar dilemma. + +== Screenshots == + +1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from +the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets +directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png` +(or jpg, jpeg, gif). +2. This is the second screen shot + +== Changelog == diff --git a/wp-content/plugins/current-ltw-projects/taxonomies/project-category.php b/wp-content/plugins/current-ltw-projects/taxonomies/project-category.php new file mode 100755 index 0000000..beb6a0d --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/taxonomies/project-category.php @@ -0,0 +1,74 @@ + true, + 'public' => true, + 'show_in_nav_menus' => true, + 'show_ui' => true, + 'show_admin_column' => false, + 'query_var' => true, + 'rewrite' => true, + 'capabilities' => array( + 'manage_terms' => 'edit_posts', + 'edit_terms' => 'edit_posts', + 'delete_terms' => 'edit_posts', + 'assign_terms' => 'edit_posts', + ), + 'labels' => array( + 'name' => __( 'Content Categories', 'current-ltw-projects' ), + 'singular_name' => _x( 'Content Category', 'taxonomy general name', 'current-ltw-projects' ), + 'search_items' => __( 'Search Content Categories', 'current-ltw-projects' ), + 'popular_items' => __( 'Popular Content Categories', 'current-ltw-projects' ), + 'all_items' => __( 'All Content Categories', 'current-ltw-projects' ), + 'parent_item' => __( 'Parent Content Category', 'current-ltw-projects' ), + 'parent_item_colon' => __( 'Parent Content Category:', 'current-ltw-projects' ), + 'edit_item' => __( 'Edit Content Category', 'current-ltw-projects' ), + 'update_item' => __( 'Update Content Category', 'current-ltw-projects' ), + 'view_item' => __( 'View Content Category', 'current-ltw-projects' ), + 'add_new_item' => __( 'Add New Content Category', 'current-ltw-projects' ), + 'new_item_name' => __( 'New Content Category', 'current-ltw-projects' ), + 'separate_items_with_commas' => __( 'Separate Content Categories with commas', 'current-ltw-projects' ), + 'add_or_remove_items' => __( 'Add or remove Content Categories', 'current-ltw-projects' ), + 'choose_from_most_used' => __( 'Choose from the most used Content Categories', 'current-ltw-projects' ), + 'not_found' => __( 'No Content Category found.', 'current-ltw-projects' ), + 'no_terms' => __( 'No Content Category', 'current-ltw-projects' ), + 'menu_name' => __( 'Content Categories', 'current-ltw-projects' ), + 'items_list_navigation' => __( 'Content Categories list navigation', 'current-ltw-projects' ), + 'items_list' => __( 'Content Categories list', 'current-ltw-projects' ), + 'most_used' => _x( 'Most Used', 'ltw-content-categories', 'current-ltw-projects' ), + 'back_to_items' => __( '← Back to Content Categories', 'current-ltw-projects' ), + ), + 'show_in_rest' => true, + 'rest_base' => 'project-category', + 'rest_controller_class' => 'WP_REST_Terms_Controller', + ) ); + +} +add_action( 'init', 'ltw_content_categories_init' ); + +/** + * Sets the post updated messages for the `ltw_content_categories` taxonomy. + * + * @param array $messages Post updated messages. + * @return array Messages for the `ltw_content_categories` taxonomy. + */ +function ltw_content_categories_updated_messages( $messages ) { + + $messages['project-category'] = array( + 0 => '', // Unused. Messages start at index 1. + 1 => __( 'Content Category added.', 'current-ltw-projects' ), + 2 => __( 'Content Category deleted.', 'current-ltw-projects' ), + 3 => __( 'Content Category updated.', 'current-ltw-projects' ), + 4 => __( 'Content Category not added.', 'current-ltw-projects' ), + 5 => __( 'Content Category not updated.', 'current-ltw-projects' ), + 6 => __( 'Content Category deleted.', 'current-ltw-projects' ), + ); + + return $messages; +} +add_filter( 'term_updated_messages', 'ltw_content_categories_updated_messages' ); diff --git a/wp-content/plugins/current-ltw-projects/taxonomies/project-org-type.php b/wp-content/plugins/current-ltw-projects/taxonomies/project-org-type.php new file mode 100755 index 0000000..efa01eb --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/taxonomies/project-org-type.php @@ -0,0 +1,74 @@ + true, + 'public' => true, + 'show_in_nav_menus' => true, + 'show_ui' => true, + 'show_admin_column' => false, + 'query_var' => true, + 'rewrite' => true, + 'capabilities' => array( + 'manage_terms' => 'edit_posts', + 'edit_terms' => 'edit_posts', + 'delete_terms' => 'edit_posts', + 'assign_terms' => 'edit_posts', + ), + 'labels' => array( + 'name' => __( 'Organization Types', 'current-ltw-projects' ), + 'singular_name' => _x( 'Organization Type', 'taxonomy general name', 'current-ltw-projects' ), + 'search_items' => __( 'Search Organization Types', 'current-ltw-projects' ), + 'popular_items' => __( 'Popular Organization Types', 'current-ltw-projects' ), + 'all_items' => __( 'All Organization Types', 'current-ltw-projects' ), + 'parent_item' => __( 'Parent Organization Type', 'current-ltw-projects' ), + 'parent_item_colon' => __( 'Parent Organization Type:', 'current-ltw-projects' ), + 'edit_item' => __( 'Edit Organization Type', 'current-ltw-projects' ), + 'update_item' => __( 'Update Organization Type', 'current-ltw-projects' ), + 'view_item' => __( 'View Organization Type', 'current-ltw-projects' ), + 'add_new_item' => __( 'Add New Organization Type', 'current-ltw-projects' ), + 'new_item_name' => __( 'New Organization Type', 'current-ltw-projects' ), + 'separate_items_with_commas' => __( 'Separate Organization Types with commas', 'current-ltw-projects' ), + 'add_or_remove_items' => __( 'Add or remove Organization Types', 'current-ltw-projects' ), + 'choose_from_most_used' => __( 'Choose from the most used Organization Types', 'current-ltw-projects' ), + 'not_found' => __( 'No Organization Types found.', 'current-ltw-projects' ), + 'no_terms' => __( 'No Organization Types', 'current-ltw-projects' ), + 'menu_name' => __( 'Organization Types', 'current-ltw-projects' ), + 'items_list_navigation' => __( 'Organization Types list navigation', 'current-ltw-projects' ), + 'items_list' => __( 'Organization Types list', 'current-ltw-projects' ), + 'most_used' => _x( 'Most Used', 'project-org-type', 'current-ltw-projects' ), + 'back_to_items' => __( '← Back to Organization Types', 'current-ltw-projects' ), + ), + 'show_in_rest' => true, + 'rest_base' => 'project-org-type', + 'rest_controller_class' => 'WP_REST_Terms_Controller', + ) ); + +} +add_action( 'init', 'project_org_type_init' ); + +/** + * Sets the post updated messages for the `project_org_type` taxonomy. + * + * @param array $messages Post updated messages. + * @return array Messages for the `project_org_type` taxonomy. + */ +function project_org_type_updated_messages( $messages ) { + + $messages['project-org-type'] = array( + 0 => '', // Unused. Messages start at index 1. + 1 => __( 'Organization Type added.', 'current-ltw-projects' ), + 2 => __( 'Organization Type deleted.', 'current-ltw-projects' ), + 3 => __( 'Organization Type updated.', 'current-ltw-projects' ), + 4 => __( 'Organization Type not added.', 'current-ltw-projects' ), + 5 => __( 'Organization Type not updated.', 'current-ltw-projects' ), + 6 => __( 'Organization Types deleted.', 'current-ltw-projects' ), + ); + + return $messages; +} +add_filter( 'term_updated_messages', 'project_org_type_updated_messages' ); diff --git a/wp-content/plugins/current-ltw-projects/taxonomies/project-status.php b/wp-content/plugins/current-ltw-projects/taxonomies/project-status.php new file mode 100755 index 0000000..cf4352b --- /dev/null +++ b/wp-content/plugins/current-ltw-projects/taxonomies/project-status.php @@ -0,0 +1,74 @@ + true, + 'public' => true, + 'show_in_nav_menus' => true, + 'show_ui' => true, + 'show_admin_column' => false, + 'query_var' => true, + 'rewrite' => true, + 'capabilities' => array( + 'manage_terms' => 'edit_posts', + 'edit_terms' => 'edit_posts', + 'delete_terms' => 'edit_posts', + 'assign_terms' => 'edit_posts', + ), + 'labels' => array( + 'name' => __( 'Status', 'current-ltw-projects' ), + 'singular_name' => _x( 'Status', 'taxonomy general name', 'current-ltw-projects' ), + 'search_items' => __( 'Search Statuses', 'current-ltw-projects' ), + 'popular_items' => __( 'Popular Statuses', 'current-ltw-projects' ), + 'all_items' => __( 'All Statuses', 'current-ltw-projects' ), + 'parent_item' => __( 'Parent Status', 'current-ltw-projects' ), + 'parent_item_colon' => __( 'Parent Status:', 'current-ltw-projects' ), + 'edit_item' => __( 'Edit Status', 'current-ltw-projects' ), + 'update_item' => __( 'Update Status', 'current-ltw-projects' ), + 'view_item' => __( 'View Status', 'current-ltw-projects' ), + 'add_new_item' => __( 'Add New Status', 'current-ltw-projects' ), + 'new_item_name' => __( 'New Status', 'current-ltw-projects' ), + 'separate_items_with_commas' => __( 'Separate Statuses with commas', 'current-ltw-projects' ), + 'add_or_remove_items' => __( 'Add or remove Statuses', 'current-ltw-projects' ), + 'choose_from_most_used' => __( 'Choose from the most used Statuses', 'current-ltw-projects' ), + 'not_found' => __( 'No Status found.', 'current-ltw-projects' ), + 'no_terms' => __( 'No Status', 'current-ltw-projects' ), + 'menu_name' => __( 'Statuses', 'current-ltw-projects' ), + 'items_list_navigation' => __( 'Statuses list navigation', 'current-ltw-projects' ), + 'items_list' => __( 'Statuses list', 'current-ltw-projects' ), + 'most_used' => _x( 'Most Used', 'ltw-status', 'current-ltw-projects' ), + 'back_to_items' => __( '← Back to Statuses', 'current-ltw-projects' ), + ), + 'show_in_rest' => true, + 'rest_base' => 'project-status', + 'rest_controller_class' => 'WP_REST_Terms_Controller', + ) ); + +} +add_action( 'init', 'ltw_status_init' ); + +/** + * Sets the post updated messages for the `ltw_status` taxonomy. + * + * @param array $messages Post updated messages. + * @return array Messages for the `ltw_status` taxonomy. + */ +function ltw_status_updated_messages( $messages ) { + + $messages['project-status'] = array( + 0 => '', // Unused. Messages start at index 1. + 1 => __( 'Status added.', 'current-ltw-projects' ), + 2 => __( 'Status deleted.', 'current-ltw-projects' ), + 3 => __( 'Status updated.', 'current-ltw-projects' ), + 4 => __( 'Status not added.', 'current-ltw-projects' ), + 5 => __( 'Status not updated.', 'current-ltw-projects' ), + 6 => __( 'Status deleted.', 'current-ltw-projects' ), + ); + + return $messages; +} +add_filter( 'term_updated_messages', 'ltw_status_updated_messages' );