diff --git a/.gitignore b/.gitignore index 21003ba..8eb312a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build/* node_modules/* sass/.sass-cache/* +sass/svg/intermediate/* +sass/symbol/* diff --git a/.travis.yml b/.travis.yml index 369ef43..1524f7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,110 +1,36 @@ -# Travis CI (MIT License) configuration file. -# @link https://travis-ci.org/ - -# Declare project language. -# @link http://about.travis-ci.org/docs/user/languages/php/ language: php -# Declare versions of PHP to use. Use one decimal max. +notifications: + email: + on_success: never + on_failure: change + +branches: + only: + - master + php: - # aliased to a recent 5.5.x version - - "5.5" - # aliased to a recent 5.4.x version - - "5.4" - # aliased to a recent 5.3.x version - - "5.3" - # Current $required_php_version for WordPress: 5.2.4 - - "5.2" + - 5.2 + - 5.3 + - 5.6 + - 7 -# Declare which versions of WordPress to test against. -# Also declare whether or not to test in Multisite. env: - # Trunk - # @link https://github.com/WordPress/WordPress - - WP_VERSION=master WP_MULTISITE=0 - - WP_VERSION=master WP_MULTISITE=1 - # WordPress 4.2 - # @link https://github.com/WordPress/WordPress/tree/4.2-branch - - WP_VERSION=4.2 WP_MULTISITE=0 - - WP_VERSION=4.2 WP_MULTISITE=1 - # WordPress 4.1 - # @link https://github.com/WordPress/WordPress/tree/4.1-branch - - WP_VERSION=4.1 WP_MULTISITE=0 - - WP_VERSION=4.1 WP_MULTISITE=1 + - WP_VERSION=latest WP_MULTISITE=0 -# Declare 5.6 beta in test matrix. -# @link https://buddypress.trac.wordpress.org/ticket/5620 -# @link http://docs.travis-ci.com/user/build-configuration/ matrix: include: - php: 5.6 - env: WP_VERSION=master - allow_failures: - - php: 5.6 - fast_finish: true + env: WP_VERSION=latest WP_MULTISITE=1 -# Use this to prepare the system to install prerequisites or dependencies. -# e.g. sudo apt-get update. -# Failures in this section will result in build status 'errored'. -# before_install: - -# Use this to prepare your build for testing. -# e.g. copy database configurations, environment variables, etc. -# Failures in this section will result in build status 'errored'. before_script: - # Set up WordPress installation. - - export WP_DEVELOP_DIR=/tmp/wordpress/ - - mkdir -p $WP_DEVELOP_DIR - # Use the Git mirror of WordPress. - - git clone --depth=1 --branch="$WP_VERSION" git://develop.git.wordpress.org/ $WP_DEVELOP_DIR - # Set up plugin information. - - plugin_slug=$(basename $(pwd)) - - plugin_dir=$WP_DEVELOP_DIR/src/wp-content/plugins/$plugin_slug - - cd .. - - mv $plugin_slug $plugin_dir - # Set up WordPress configuration. - - cd $WP_DEVELOP_DIR - - echo $WP_DEVELOP_DIR - - cp wp-tests-config-sample.php wp-tests-config.php - - sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php - - sed -i "s/yourusernamehere/root/" wp-tests-config.php - - sed -i "s/yourpasswordhere//" wp-tests-config.php - # Create WordPress database. - - mysql -e 'CREATE DATABASE wordpress_test;' -uroot - # Install CodeSniffer for WordPress Coding Standards checks. - - git clone https://github.com/squizlabs/PHP_CodeSniffer.git php-codesniffer - # Install WordPress Coding Standards. - - git clone https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wordpress-coding-standards - # Hop into CodeSniffer directory. - - cd php-codesniffer - # Set install path for WordPress Coding Standards. - # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 - - scripts/phpcs --config-set installed_paths ../wordpress-coding-standards - # Hop into plugin directory. - - cd $plugin_dir - # After CodeSniffer install you should refresh your path. - - phpenv rehash - -# Run test script commands. -# Default is specific to project language. -# All commands must exit with code 0 on success. Anything else is considered failure. -script: - # Search for PHP syntax errors. - - find . \( -name '*.php' \) -exec php -lf {} \; - # WordPress Coding Standards - # @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards - # @link http://pear.php.net/package/PHP_CodeSniffer/ - # -p flag: Show progress of the run. - # -s flag: Show sniff codes in all reports. - # -v flag: Print verbose output. - # -n flag: Do not print warnings. (shortcut for --warning-severity=0) - # -l flag: Run locally - # --standard: Use WordPress as the standard. - # --extensions: Only sniff PHP files. - - $WP_DEVELOP_DIR/php-codesniffer/scripts/phpcs -l -p -s -v -n . --standard=WordPress --extensions=php - - $WP_DEVELOP_DIR/php-codesniffer/scripts/phpcs -p -s -v -n includes/ --standard=WordPress --extensions=php - -# Receive notifications for build results. -# @link http://docs.travis-ci.com/user/notifications/#Email-notifications -notifications: - email: false + - export PATH="$HOME/.composer/vendor/bin:$PATH" + - | + if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then + composer global require "phpunit/phpunit=5.7.*" + elif [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then + composer global require "phpunit/phpunit=4.8.*" + fi + - bash bin/install-wp-tests.sh wordpress root '' localhost $WP_VERSION + +script: phpunit diff --git a/css/kind.css b/css/kind.css index 9eb1583..69f36c0 100644 --- a/css/kind.css +++ b/css/kind.css @@ -36,13 +36,13 @@ .response blockquote { margin-left: 25px; } -.response .u-url:link { +.response a:link { text-decoration: none; } -.response .u-url:hover { +.response a:hover { text-decoration: none; } -.response .u-photo, .response .u-featured { +.response img { padding: 0; margin: 2px; } @@ -52,7 +52,7 @@ ul.cites { display: inline; } -.embeds { +.kind-embeds { text-align: center; position: relative; width: 100%; diff --git a/css/kind.css.map b/css/kind.css.map index f830e67..08565cf 100644 --- a/css/kind.css.map +++ b/css/kind.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": ";;AACC,mBAAU;EACT,IAAI,EAAE,YAAY;EAClB,YAAY,EAAE,GAAG;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,cAAc,EAAE,MAAM;EACtB,GAAG,EAAE,SAAS;EACd,KAAK,EAAE,IAAI;;;AAKL,mBAAU;EACF,IAAI,EAAE,YAAY;EAClB,YAAY,EAAE,GAAG;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,cAAc,EAAE,MAAM;EACtB,GAAG,EAAE,SAAS;EACd,KAAK,EAAE,KAAK;;;ACtB5B,SAAU;EACN,aAAa,EAAE,IAAI;EACnB,UAAU,EAAE,IAAI;EAChB,WAAW,EAAE,IAAI;EACjB,OAAO,EAAE,GAAG;EACZ,SAAS,EAAE,IAAI;EACf,aAAa,EAAE,aAAa;;AAC9B,oBAAW;EACV,YAAY,EAAE,GAAG;;AAElB,oBAAW;EACV,WAAW,EAAE,IAAI;;AAGnB,qBAAY;EACX,eAAe,EAAE,IAAI;;AAGtB,sBAAa;EACZ,eAAe,EAAE,IAAI;;AAGtB,yCAAuB;EACrB,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,GAAG;;;AAId,QAAS;EACL,UAAU,EAAE,IAAI;EAChB,OAAO,EAAE,MAAM;;;AAGnB,OAAQ;EACJ,UAAU,EAAE,MAAM;EAClB,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,GAAG", +"mappings": ";;AACC,mBAAU;EACT,IAAI,EAAE,YAAY;EAClB,YAAY,EAAE,GAAG;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,cAAc,EAAE,MAAM;EACtB,GAAG,EAAE,SAAS;EACd,KAAK,EAAE,IAAI;;;AAKL,mBAAU;EACF,IAAI,EAAE,YAAY;EAClB,YAAY,EAAE,GAAG;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,cAAc,EAAE,MAAM;EACtB,GAAG,EAAE,SAAS;EACd,KAAK,EAAE,KAAK;;;ACtB5B,SAAU;EACN,aAAa,EAAE,IAAI;EACnB,UAAU,EAAE,IAAI;EAChB,WAAW,EAAE,IAAI;EACjB,OAAO,EAAE,GAAG;EACZ,SAAS,EAAE,IAAI;EACf,aAAa,EAAE,aAAa;;AAC9B,oBAAW;EACV,YAAY,EAAE,GAAG;;AAElB,oBAAW;EACV,WAAW,EAAE,IAAI;;AAGnB,gBAAO;EACN,eAAe,EAAE,IAAI;;AAGtB,iBAAQ;EACP,eAAe,EAAE,IAAI;;AAGtB,aAAK;EACH,OAAO,EAAE,CAAC;EACV,MAAM,EAAE,GAAG;;;AAId,QAAS;EACL,UAAU,EAAE,IAAI;EAChB,OAAO,EAAE,MAAM;;;AAGnB,YAAa;EACT,UAAU,EAAE,MAAM;EAClB,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI;EACX,UAAU,EAAE,GAAG", "sources": ["../sass/_kinds.scss","../sass/_frontend.scss"], "names": [], "file": "kind.css" diff --git a/css/kind.min.css b/css/kind.min.css index a44b7fd..1732f8f 100644 --- a/css/kind.min.css +++ b/css/kind.min.css @@ -1,2 +1,2 @@ -#kind-all .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:24px;height:24px;vertical-align:middle;top:-0.0625em;color:grey}.response .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:32px;height:32px;vertical-align:middle;top:-0.0625em;color:#000}.response{margin-bottom:10px;margin-top:10px;margin-left:20px;padding:5px;font-size:16px;border-bottom:inset #D6D6D6}.response .kind-icon{margin-right:3px}.response blockquote{margin-left:25px}.response .u-url:link{text-decoration:none}.response .u-url:hover{text-decoration:none}.response .u-photo,.response .u-featured{padding:0;margin:2px}ul.cites{list-style:none;display:inline}.embeds{text-align:center;position:relative;width:100%;margin-top:5px} +#kind-all .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:24px;height:24px;vertical-align:middle;top:-0.0625em;color:grey}.response .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:32px;height:32px;vertical-align:middle;top:-0.0625em;color:#000}.response{margin-bottom:10px;margin-top:10px;margin-left:20px;padding:5px;font-size:16px;border-bottom:inset #D6D6D6}.response .kind-icon{margin-right:3px}.response blockquote{margin-left:25px}.response a:link{text-decoration:none}.response a:hover{text-decoration:none}.response img{padding:0;margin:2px}ul.cites{list-style:none;display:inline}.kind-embeds{text-align:center;position:relative;width:100%;margin-top:5px} /*# sourceMappingURL=kind.min.css.map */ diff --git a/css/kind.min.css.map b/css/kind.min.css.map index 79607ab..d75d3ed 100644 --- a/css/kind.min.css.map +++ b/css/kind.min.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AACC,mBAAU,CACT,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAI,CAKL,mBAAU,CACF,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAK,CCtB5B,SAAU,CACN,aAAa,CAAE,IAAI,CACnB,UAAU,CAAE,IAAI,CAChB,WAAW,CAAE,IAAI,CACjB,OAAO,CAAE,GAAG,CACZ,SAAS,CAAE,IAAI,CACf,aAAa,CAAE,aAAa,CAC9B,oBAAW,CACV,YAAY,CAAE,GAAG,CAElB,oBAAW,CACV,WAAW,CAAE,IAAI,CAGnB,qBAAY,CACX,eAAe,CAAE,IAAI,CAGtB,sBAAa,CACZ,eAAe,CAAE,IAAI,CAGtB,wCAAuB,CACrB,OAAO,CAAE,CAAC,CACV,MAAM,CAAE,GAAG,CAId,QAAS,CACL,UAAU,CAAE,IAAI,CAChB,OAAO,CAAE,MAAM,CAGnB,OAAQ,CACJ,UAAU,CAAE,MAAM,CAClB,QAAQ,CAAE,QAAQ,CAClB,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,GAAG", +"mappings": "AACC,mBAAU,CACT,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAI,CAKL,mBAAU,CACF,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAK,CCtB5B,SAAU,CACN,aAAa,CAAE,IAAI,CACnB,UAAU,CAAE,IAAI,CAChB,WAAW,CAAE,IAAI,CACjB,OAAO,CAAE,GAAG,CACZ,SAAS,CAAE,IAAI,CACf,aAAa,CAAE,aAAa,CAC9B,oBAAW,CACV,YAAY,CAAE,GAAG,CAElB,oBAAW,CACV,WAAW,CAAE,IAAI,CAGnB,gBAAO,CACN,eAAe,CAAE,IAAI,CAGtB,iBAAQ,CACP,eAAe,CAAE,IAAI,CAGtB,aAAK,CACH,OAAO,CAAE,CAAC,CACV,MAAM,CAAE,GAAG,CAId,QAAS,CACL,UAAU,CAAE,IAAI,CAChB,OAAO,CAAE,MAAM,CAGnB,YAAa,CACT,UAAU,CAAE,MAAM,CAClB,QAAQ,CAAE,QAAQ,CAClB,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,GAAG", "sources": ["../sass/_kinds.scss","../sass/_frontend.scss"], "names": [], "file": "kind.min.css" diff --git a/css/kind.themecompat.min.css b/css/kind.themecompat.min.css index 4ed71ae..9916d25 100644 --- a/css/kind.themecompat.min.css +++ b/css/kind.themecompat.min.css @@ -1,2 +1,2 @@ -#kind-all .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:24px;height:24px;vertical-align:middle;top:-0.0625em;color:grey}.response .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:32px;height:32px;vertical-align:middle;top:-0.0625em;color:#000}.response{margin-bottom:10px;margin-top:10px;margin-left:20px;padding:5px;font-size:16px;border-bottom:inset #D6D6D6}.response .kind-icon{margin-right:3px}.response blockquote{margin-left:25px}.response .u-url:link{text-decoration:none}.response .u-url:hover{text-decoration:none}.response .u-photo,.response .u-featured{padding:0;margin:2px}ul.cites{list-style:none;display:inline}.embeds{text-align:center;position:relative;width:100%;margin-top:5px}.kind-note .entry-title,.kind-bookmark .entry-title,.kind-reply .entry-title,.kind-like .entry-title,.kind-favorite .entry-title,.kind-photo .entry-title,.kind-tag .entry-title,.kind-rsvp .entry-title,.kind-listen .entry-title,.kind-watch .entry-title,.kind-checkin .entry-title,.kind-wish .entry-title,.kind-play .entry-title,.kind-weather .entry-title,.kind-exercise .entry-title,.kind-travel .entry-title,.kind-eat .entry-title,.kind-drink .entry-title,.kind-follow .entry-title,.kind-jam .entry-title,.kind-read .entry-title,.kind-quote .entry-title{display:none} +#kind-all .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:24px;height:24px;vertical-align:middle;top:-0.0625em;color:grey}.response .svg-icon{fill:currentColor;padding-left:2px;padding-right:2px;width:32px;height:32px;vertical-align:middle;top:-0.0625em;color:#000}.response{margin-bottom:10px;margin-top:10px;margin-left:20px;padding:5px;font-size:16px;border-bottom:inset #D6D6D6}.response .kind-icon{margin-right:3px}.response blockquote{margin-left:25px}.response a:link{text-decoration:none}.response a:hover{text-decoration:none}.response img{padding:0;margin:2px}ul.cites{list-style:none;display:inline}.kind-embeds{text-align:center;position:relative;width:100%;margin-top:5px}.kind-note .entry-title,.kind-bookmark .entry-title,.kind-reply .entry-title,.kind-like .entry-title,.kind-favorite .entry-title,.kind-photo .entry-title,.kind-tag .entry-title,.kind-rsvp .entry-title,.kind-listen .entry-title,.kind-watch .entry-title,.kind-checkin .entry-title,.kind-wish .entry-title,.kind-play .entry-title,.kind-weather .entry-title,.kind-exercise .entry-title,.kind-travel .entry-title,.kind-eat .entry-title,.kind-drink .entry-title,.kind-follow .entry-title,.kind-jam .entry-title,.kind-read .entry-title,.kind-quote .entry-title{display:none} /*# sourceMappingURL=kind.themecompat.min.css.map */ diff --git a/css/kind.themecompat.min.css.map b/css/kind.themecompat.min.css.map index 8e92015..a088c4e 100644 --- a/css/kind.themecompat.min.css.map +++ b/css/kind.themecompat.min.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AACC,mBAAU,CACT,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAI,CAKL,mBAAU,CACF,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAK,CCtB5B,SAAU,CACN,aAAa,CAAE,IAAI,CACnB,UAAU,CAAE,IAAI,CAChB,WAAW,CAAE,IAAI,CACjB,OAAO,CAAE,GAAG,CACZ,SAAS,CAAE,IAAI,CACf,aAAa,CAAE,aAAa,CAC9B,oBAAW,CACV,YAAY,CAAE,GAAG,CAElB,oBAAW,CACV,WAAW,CAAE,IAAI,CAGnB,qBAAY,CACX,eAAe,CAAE,IAAI,CAGtB,sBAAa,CACZ,eAAe,CAAE,IAAI,CAGtB,wCAAuB,CACrB,OAAO,CAAE,CAAC,CACV,MAAM,CAAE,GAAG,CAId,QAAS,CACL,UAAU,CAAE,IAAI,CAChB,OAAO,CAAE,MAAM,CAGnB,OAAQ,CACJ,UAAU,CAAE,MAAM,CAClB,QAAQ,CAAE,QAAQ,CAClB,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,GAAG,CCpClB,yiBAAa,CACZ,OAAO,CAAE,IAAI", +"mappings": "AACC,mBAAU,CACT,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAI,CAKL,mBAAU,CACF,IAAI,CAAE,YAAY,CAClB,YAAY,CAAE,GAAG,CACjB,aAAa,CAAE,GAAG,CAClB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CACZ,cAAc,CAAE,MAAM,CACtB,GAAG,CAAE,SAAS,CACd,KAAK,CAAE,IAAK,CCtB5B,SAAU,CACN,aAAa,CAAE,IAAI,CACnB,UAAU,CAAE,IAAI,CAChB,WAAW,CAAE,IAAI,CACjB,OAAO,CAAE,GAAG,CACZ,SAAS,CAAE,IAAI,CACf,aAAa,CAAE,aAAa,CAC9B,oBAAW,CACV,YAAY,CAAE,GAAG,CAElB,oBAAW,CACV,WAAW,CAAE,IAAI,CAGnB,gBAAO,CACN,eAAe,CAAE,IAAI,CAGtB,iBAAQ,CACP,eAAe,CAAE,IAAI,CAGtB,aAAK,CACH,OAAO,CAAE,CAAC,CACV,MAAM,CAAE,GAAG,CAId,QAAS,CACL,UAAU,CAAE,IAAI,CAChB,OAAO,CAAE,MAAM,CAGnB,YAAa,CACT,UAAU,CAAE,MAAM,CAClB,QAAQ,CAAE,QAAQ,CAClB,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,GAAG,CCpClB,yiBAAa,CACZ,OAAO,CAAE,IAAI", "sources": ["../sass/_kinds.scss","../sass/_frontend.scss","../sass/_hide-titles.scss"], "names": [], "file": "kind.themecompat.min.css" diff --git a/includes/class-kind-meta.php b/includes/class-kind-meta.php index c077bb2..efaf471 100644 --- a/includes/class-kind-meta.php +++ b/includes/class-kind-meta.php @@ -350,7 +350,7 @@ public function build_time($date, $time, $offset) { return $date . 'T' . $time . $offset; } - public static function dateIntervalToString(\DateInterval $interval) { + public static function DateIntervalToString(\DateInterval $interval) { // Reading all non-zero date parts. $date = array_filter(array( 'Y' => $interval->y, @@ -403,7 +403,7 @@ public function calculate_duration( $start_string, $end_string ) { $end = date_create_from_format( 'Y-m-d\TH:i:sP', $end_string ); if ( ($start instanceof DateTime) && ($end instanceof DateTime) ) { $duration = $start->diff( $end ); - return self::dateIntervalToString( $duration ); + return self::DateIntervalToString( $duration ); } return false; } diff --git a/includes/class-kind-taxonomy.php b/includes/class-kind-taxonomy.php index faae76d..019296e 100755 --- a/includes/class-kind-taxonomy.php +++ b/includes/class-kind-taxonomy.php @@ -24,9 +24,8 @@ public static function init() { // Add Links to Ping to the Webmention Sender. add_filter( 'webmention_links', array( 'Kind_Taxonomy', 'webmention_links' ), 11, 2 ); - // Add Classes to Post and Body. + // Add Classes to Post. add_filter( 'post_class', array( 'Kind_Taxonomy', 'post_class' ) ); - add_filter( 'body_class', array( 'Kind_Taxonomy', 'body_class' ) ); // Trigger Webmention on Change in Post Status. add_filter( 'transition_post_status', array( 'Kind_Taxonomy', 'transition' ), 10, 3 ); @@ -506,48 +505,14 @@ public static function transition( $new, $old, $post ) { } } - public static function kinds_as_type($classes) { - $kind = get_post_kind_slug(); - switch ( $kind ) { - case 'note': - $classes[] = 'h-as-note'; - break; - case 'article': - $classes[] = 'h-as-article'; - break; - case 'photo': - $classes[] = 'h-as-image'; - break; - case 'bookmark': - $classes[] = 'h-as-bookmark'; - break; - } - return $classes; - } - public static function post_class($classes) { if ( 'post' !== get_post_type() ) { return $classes; } - // Adds kind classes to post - if ( ! is_singular() ) { - $classes = self::kinds_as_type( $classes ); - } $classes[] = 'kind-' . get_post_kind_slug(); return $classes; } - public static function body_class($classes) { - if ( 'post' !== get_post_type() ) { - return $classes; - } - // Adds kind classes to body - if ( is_singular() ) { - $classes = self::kinds_as_type( $classes ); - } - return $classes; - } - /** * Returns a pretty, translated version of a post kind slug * diff --git a/includes/class-kind-view.php b/includes/class-kind-view.php index 2da215f..eefb334 100644 --- a/includes/class-kind-view.php +++ b/includes/class-kind-view.php @@ -8,8 +8,21 @@ // The Kind_View class sets up the kind display behavior for kinds class Kind_View { public static function init() { - add_filter( 'the_content', array( 'Kind_View', 'content_response' ), 20 ); - add_filter( 'the_excerpt', array( 'Kind_View', 'excerpt_response' ), 20 ); + add_filter( 'the_content', array( 'Kind_View', 'content_response' ), 20 ); + add_filter( 'the_excerpt', array( 'Kind_View', 'excerpt_response' ), 20 ); + add_filter( 'wp_get_attachment_image_attributes', array( 'Kind_View', 'wp_get_attachment_image_attributes' ), 10 ); + } + + public static function wp_get_attachment_image_attributes( array $attr ) { + if ( isset( $attr['class'] ) ) { + $class = explode( " ", $attr['class'] ); + $class[] = 'u-photo'; + $attr['class'] = implode( " ", array_unique( $class ) ); + } + else{ + $attr['class'] = 'u-photo'; + } + return $attr; } // This mirrors get_template_part but for views and locates the correct file and returns the output @@ -38,12 +51,15 @@ public static function get_view_part($slug, $name = null) { include ( $located ); $return = ob_get_contents(); ob_end_clean(); - return $return; + return wp_make_content_images_responsive( $return ); } // Return the Display - public static function get_display( $post_ID ) { + public static function get_display( $post_ID = null ) { + if ( ! $post_ID ) { + $post_ID = get_the_ID(); + } if ( 'post' === get_post_type( $post_ID ) ) { $kind = get_post_kind_slug( $post_ID ); $content = self::get_view_part( 'kind', $kind ); @@ -52,21 +68,21 @@ public static function get_display( $post_ID ) { } // Echo the output of get_display - public static function display( ) { - echo self::get_display( ); + public static function display( $post_ID = null ) { + echo self::get_display( $post_ID ); } public static function content_response ( $content ) { - return self::get_display( get_the_ID() ) . $content; + return self::get_display( ) . $content; } public static function excerpt_response ( $content ) { global $post; if ( has_excerpt( get_the_ID() ) ) { - return self::get_display( get_the_ID() ) . get_the_excerpt(); + return self::get_display( ) . get_the_excerpt(); } else { - return self::get_display( get_the_ID() ) . wp_trim_words( $post->post_content ); + return self::get_display( ) . wp_trim_words( $post->post_content ); } } @@ -129,7 +145,7 @@ public static function get_embed( $url ) { if ( strcmp( $embed, $url ) == 0 ) { $embed = ''; } else { - $embed = '
' . $embed . '
'; + $embed = '
' . $embed . '
'; } return $embed; } @@ -262,5 +278,49 @@ public static function get_site_name($cite, $url) { return sprintf( '%1s', $cite['publication'] ); } + public static function rsvp_text( $type ) { + $rsvp = array( + 'yes' => __( 'Attending %2s', 'indieweb-post-kinds' ), + 'maybe' => __( 'Might be attending %2s', 'indieweb-post-kinds' ), + 'no' => __( 'Unable to Attend %2s', 'indieweb-post-kinds' ), + 'interested' => __( 'Interested in Attending %s', 'indieweb-post-kinds' ) + ); + return $rsvp[ $type ]; + } + + public static function display_duration( $duration ) { + if ( ! $duration ) { + return ''; + } + $interval = new DateInterval( $duration ); + $bits = array( + 'year' => $interval->y, + 'month' => $interval->m, + 'day' => $interval->d, + 'hour' => $interval->h, + 'minute' => $interval->i, + 'second' => $interval->s, + ); + $return = ''; + if ( $bits['year'] > 0 ) { + $return .= sprintf( _n( '%d year', '%d years', $bits['year'], 'indieweb-post-kinds' ), $bits['year'] ); + } + if ( $bits['month'] > 0 ) { + $return .= sprintf( _n( ' %d month', ' %d months', $bits['month'], 'indieweb-post-kinds' ), $bits['month'] ); + } + if ( $bits['day'] > 0 ) { + $return .= sprintf( _n( ' %d day', ' %d days', $bits['day'], 'indieweb-post-kinds' ), $bits['day'] ); + } + if ( $bits['hour'] > 0 ) { + $return .= sprintf( _n( ' %d hour', ' %d hours', $bits['hour'], 'indieweb-post-kinds' ), $bits['hour'] ); + } + if ( $bits['minute'] > 0 ) { + $return .= sprintf( _n( ' %d minute', ' %d minutes', $bits['minute'], 'indieweb-post-kinds' ), $bits['minute'] ); + } + if ( $bits['second'] > 0 ) { + $return .= sprintf( _n( ' %d second', ' %d seconds', $bits['second'], 'indieweb-post-kinds' ), $bits['second'] ); + } + return trim( $return ); + } } // End Class diff --git a/includes/kind-functions.php b/includes/kind-functions.php index aa0787f..5cc4071 100755 --- a/includes/kind-functions.php +++ b/includes/kind-functions.php @@ -106,8 +106,8 @@ function get_kind_view_part($slug, $name = null) { Kind_View::get_view_part( $slug, $name ); } -function kind_response_display() { - echo apply_filters( 'kind_response_display', '' ); +function kind_display( $post_ID = null ) { + echo Kind_View::get_display( $post_ID ); } diff --git a/includes/views/kind-bookmark.php b/includes/views/kind-bookmark.php new file mode 100644 index 0000000..d5f5306 --- /dev/null +++ b/includes/views/kind-bookmark.php @@ -0,0 +1,49 @@ +get_author() ); +$cite = $meta->get_cite(); +$url = $meta->get_url(); +$embed = self::get_embed( $meta->get_url() ); + +?> + +
+
+%2s', $url, $cite['name'] ); + } else { + echo sprintf( '%1s', $cite['name'] ); + } + if ( $author ) { + echo ' ' . __( 'by', 'indieweb-post-kinds' ) . ' ' . $author; + } + if ( array_key_exists( 'publication', $cite ) ) { + echo sprintf( ' (%1s)', $cite['publication'] ); + } +} +?> +
+%1s', $embed ); + } else if ( array_key_exists( 'summary', $cite ) ) { + echo sprintf( '
%1s
', $cite['summary'] ); + } +} + +// Close Response +?> +
+ +get_author() ); +$cite = $meta->get_cite(); +$url = $meta->get_url(); +$embed = self::get_embed( $meta->get_url() ); + +?> + +
+
+%2s', $url, $cite['name'] ); + } else { + echo sprintf( '%1s', $cite['name'] ); + } + if ( $author ) { + echo ' ' . __( 'by', 'indieweb-post-kinds' ) . ' ' . $author; + } + if ( array_key_exists( 'publication', $cite ) ) { + echo sprintf( ' (%1s)', $cite['publication'] ); + } +} +?> +
+%1s', $embed ); + } else if ( array_key_exists( 'summary', $cite ) ) { + echo sprintf( '
%1s
', $cite['summary'] ); + } +} + +// Close Response +?> +
+ +get_author() ); +$cite = $meta->get_cite(); +$site_name = Kind_View::get_site_name( $meta->get_cite(), $meta->get_url() ); +$title = Kind_View::get_cite_title( $meta->get_cite(), $meta->get_url() ); +$embed = self::get_embed( $meta->get_url() ); +$duration = $meta->get_duration(); + +?> + +
+
+' . $site_name . ''; + } + if ( $duration ) { + echo '(' . Kind_View::display_duration( $duration ) . ')'; + } +} +?> +
+%1s', $embed ); + } else if ( array_key_exists( 'summary', $cite ) ) { + echo sprintf( '
%1s
', $cite['summary'] ); + } +} + +// Close Response +?> +
+ +get_author() ); +$cite = $meta->get_cite(); +$url = $meta->get_url(); +$embed = self::get_embed( $meta->get_url() ); + +?> + +
+
+%2s', $url, $cite['name'] ); + } else { + echo sprintf( '%1s', $cite['name'] ); + } + if ( $author ) { + echo ' ' . __( 'by', 'indieweb-post-kinds' ) . ' ' . $author; + } + if ( array_key_exists( 'publication', $cite ) ) { + echo sprintf( ' (%1s)', $cite['publication'] ); + } +} +?> +
+%1s', $embed ); + } else if ( array_key_exists( 'summary', $cite ) ) { + echo sprintf( '
%1s
', $cite['summary'] ); + } +} + +// Close Response +?> +
+ +get_author() ); +$cite = $meta->get_cite(); +$site_name = Kind_View::get_site_name( $meta->get_cite(), $meta->get_url() ); +$title = Kind_View::get_cite_title( $meta->get_cite(), $meta->get_url() ); +$embed = self::get_embed( $meta->get_url() ); +$duration = $meta->get_duration(); + +?> + +
+
+' . $site_name . ''; + } + if ( $duration ) { + echo '(' . Kind_View::display_duration( $duration ) . ')'; + } +} +?> +
+%1s', $embed ); + } else if ( array_key_exists( 'summary', $cite ) ) { + echo sprintf( '
%1s
', $cite['summary'] ); + } +} + +// Close Response +?> +
+ + +
+
+ +
+
+

+ 'u-featured' ) ); +} +elseif ( $photos ) { + echo gallery_shortcode( + array( + 'id' => get_the_ID() , + 'size' => 'large', + 'columns' => 1, + 'link' => 'file' + ) ); +} +?> +

+get_author() ); +$cite = $meta->get_cite(); +$url = $meta->get_url(); +$title = isset( $cite['name'] ) ? $cite['name'] : $url; +$embed = self::get_embed( $url ); +$rsvp = $meta->get( 'rsvp' ); + +?> + +
+
+' . $rsvp . '">' . sprintf( Kind_View::rsvp_text( $rsvp ), $url, $title ) . ''; + } +} +?> +
+%1s', $embed ); +} else if ( array_key_exists( 'summary', $cite ) ) { + echo sprintf( '
%1s
', $cite['summary'] ); +} + +// Close Response +?> +
+ +get_author() ); +$cite = $meta->get_cite(); +$site_name = Kind_View::get_site_name( $meta->get_cite(), $meta->get_url() ); +$title = Kind_View::get_cite_title( $meta->get_cite(), $meta->get_url() ); +$embed = self::get_embed( $meta->get_url() ); +$duration = $meta->get_duration(); + +?> + +
+
+' . $site_name . ''; + } + if ( $duration ) { + echo '(' . Kind_View::display_duration( $duration ) . ')'; + } +} +?> +
+%1s', $embed ); + } else if ( array_key_exists( 'summary', $cite ) ) { + echo sprintf( '
%1s
', $cite['summary'] ); + } +} + +// Close Response +?> +
+ +(' . $site_name . ')'; + echo ' (' . $site_name . ''; } if ( in_array( $kind, array( 'jam', 'listen', 'play', 'read', 'watch' ) ) ) { $duration = $meta->get_duration(); diff --git a/indieweb-post-kinds.php b/indieweb-post-kinds.php index bc64de2..5183267 100755 --- a/indieweb-post-kinds.php +++ b/indieweb-post-kinds.php @@ -7,7 +7,7 @@ * Plugin Name: Post Kinds * Plugin URI: https://wordpress.org/plugins/indieweb-post-kinds/ * Description: Ever want to reply to someone else's post with a post on your own site? Or to "like" someone else's post, but with your own site? - * Version: 2.5.2 + * Version: 2.6.0 * Author: David Shanske * Author URI: https://david.shanske.com * Text Domain: indieweb-post-kinds @@ -23,7 +23,7 @@ add_action( 'init', array( 'Post_Kinds_Plugin', 'init' ) ); class Post_Kinds_Plugin { - public static $version = '2.5.2'; + public static $version = '2.6.0'; public static function init() { // Add Kind Taxonomy. require_once plugin_dir_path( __FILE__ ) . 'includes/class-kind-taxonomy.php'; diff --git a/languages/post_kinds.pot b/languages/post_kinds.pot index 4c48d64..9ddf352 100644 --- a/languages/post_kinds.pot +++ b/languages/post_kinds.pot @@ -2,10 +2,10 @@ # This file is distributed under the same license as the Post Kinds package. msgid "" msgstr "" -"Project-Id-Version: Post Kinds 2.5.2\n" +"Project-Id-Version: Post Kinds 2.6.0\n" "Report-Msgid-Bugs-To: " "http://wordpress.org/support/plugin/indieweb-post-kinds\n" -"POT-Creation-Date: 2017-04-14 17:41:45+00:00\n" +"POT-Creation-Date: 2017-06-10 16:46:32+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -121,134 +121,186 @@ msgstr "" msgid "RSVP" msgstr "" -#: includes/class-kind-taxonomy.php:207 +#: includes/class-kind-taxonomy.php:206 msgid "traditional long form content: a post with an explicit title and body" msgstr "" -#: includes/class-kind-taxonomy.php:216 +#: includes/class-kind-taxonomy.php:215 msgid "" "short content: a post or status update with just plain content and " "typically without a title" msgstr "" -#: includes/class-kind-taxonomy.php:225 +#: includes/class-kind-taxonomy.php:224 msgid "a reply to content typically on another site" msgstr "" -#: includes/class-kind-taxonomy.php:234 +#: includes/class-kind-taxonomy.php:233 msgid "a complete reposting of content from another site" msgstr "" -#: includes/class-kind-taxonomy.php:243 +#: includes/class-kind-taxonomy.php:242 msgid "a way to pay compliments to the original post/poster of external content" msgstr "" -#: includes/class-kind-taxonomy.php:252 +#: includes/class-kind-taxonomy.php:251 msgid "special to the author" msgstr "" -#: includes/class-kind-taxonomy.php:261 +#: includes/class-kind-taxonomy.php:260 msgid "storing a link/bookmark for personal use or sharing with others" msgstr "" -#: includes/class-kind-taxonomy.php:270 +#: includes/class-kind-taxonomy.php:269 msgid "a post with an embedded image/photo as its primary focus" msgstr "" -#: includes/class-kind-taxonomy.php:279 +#: includes/class-kind-taxonomy.php:278 msgid "" "allows you to tag a post as being of a specific category or tag, or for " "person tagging" msgstr "" -#: includes/class-kind-taxonomy.php:288 +#: includes/class-kind-taxonomy.php:287 msgid "a specific type of reply regarding attendance of an event" msgstr "" -#: includes/class-kind-taxonomy.php:297 +#: includes/class-kind-taxonomy.php:296 msgid "listening to audio; sometimes called a scrobble" msgstr "" -#: includes/class-kind-taxonomy.php:306 +#: includes/class-kind-taxonomy.php:305 msgid "" "watching a movie, television show, online video, play or other visual-based " "event" msgstr "" -#: includes/class-kind-taxonomy.php:315 +#: includes/class-kind-taxonomy.php:314 msgid "identifying you are at a particular geographic location" msgstr "" -#: includes/class-kind-taxonomy.php:324 +#: includes/class-kind-taxonomy.php:323 msgid "" "a post indicating a desire/wish. The archive of which would be a wishlist, " "such as a gift registry or similar" msgstr "" -#: includes/class-kind-taxonomy.php:333 +#: includes/class-kind-taxonomy.php:332 msgid "playing a game" msgstr "" -#: includes/class-kind-taxonomy.php:342 +#: includes/class-kind-taxonomy.php:341 msgid "current weather conditions" msgstr "" -#: includes/class-kind-taxonomy.php:351 +#: includes/class-kind-taxonomy.php:350 msgid "" "some form of physical activity or workout (examples: walk, run, cycle, " "hike, yoga, etc.)" msgstr "" -#: includes/class-kind-taxonomy.php:360 +#: includes/class-kind-taxonomy.php:359 msgid "represents a geographic journey" msgstr "" -#: includes/class-kind-taxonomy.php:369 +#: includes/class-kind-taxonomy.php:368 msgid "parts of a scheduled trip including transit by car, plane, train, etc." msgstr "" -#: includes/class-kind-taxonomy.php:378 +#: includes/class-kind-taxonomy.php:377 msgid "what you are eating, perhaps for a food dairy" msgstr "" -#: includes/class-kind-taxonomy.php:387 +#: includes/class-kind-taxonomy.php:386 msgid "what you are drinking, perhaps for a food dairy" msgstr "" -#: includes/class-kind-taxonomy.php:396 +#: includes/class-kind-taxonomy.php:395 msgid "" "indicating you are now following or subscribing to another person`s " "activities online" msgstr "" -#: includes/class-kind-taxonomy.php:405 +#: includes/class-kind-taxonomy.php:404 msgid "a particularly personally meaningful song (a listen with added emphasis)" msgstr "" -#: includes/class-kind-taxonomy.php:414 +#: includes/class-kind-taxonomy.php:413 msgid "reading a book, magazine, newspaper, other physical document, or online post" msgstr "" -#: includes/class-kind-taxonomy.php:423 +#: includes/class-kind-taxonomy.php:422 msgid "quoted content" msgstr "" -#: includes/class-kind-taxonomy.php:432 +#: includes/class-kind-taxonomy.php:431 msgid "how you are feeling (example: happy, sad, indifferent, etc.)" msgstr "" -#: includes/class-kind-taxonomy.php:441 +#: includes/class-kind-taxonomy.php:440 msgid "list of ingredients and directions for making food or drink" msgstr "" -#: includes/class-kind-taxonomy.php:625 +#: includes/class-kind-taxonomy.php:590 msgid "Invalid post" msgstr "" -#: includes/class-kind-taxonomy.php:628 +#: includes/class-kind-taxonomy.php:593 msgid "Invalid Kind" msgstr "" +#: includes/class-kind-view.php:270 +msgid "Attending %2s" +msgstr "" + +#: includes/class-kind-view.php:271 +msgid "Might be attending %2s" +msgstr "" + +#: includes/class-kind-view.php:272 +msgid "Unable to Attend %2s" +msgstr "" + +#: includes/class-kind-view.php:273 +msgid "Interested in Attending %s" +msgstr "" + +#: includes/class-kind-view.php:293 +msgid "%d year" +msgid_plural "%d years" +msgstr[0] "" +msgstr[1] "" + +#: includes/class-kind-view.php:296 +msgid " %d month" +msgid_plural " %d months" +msgstr[0] "" +msgstr[1] "" + +#: includes/class-kind-view.php:299 +msgid " %d day" +msgid_plural " %d days" +msgstr[0] "" +msgstr[1] "" + +#: includes/class-kind-view.php:302 +msgid " %d hour" +msgid_plural " %d hours" +msgstr[0] "" +msgstr[1] "" + +#: includes/class-kind-view.php:305 +msgid " %d minute" +msgid_plural " %d minutes" +msgstr[0] "" +msgstr[1] "" + +#: includes/class-kind-view.php:308 +msgid " %d second" +msgid_plural " %d seconds" +msgstr[0] "" +msgstr[1] "" + #: includes/class-link-preview.php:101 includes/class-link-preview.php:106 msgid "Missing or Invalid URL" msgstr "" @@ -331,10 +383,18 @@ msgstr "" msgid "End Time" msgstr "" +#: includes/views/kind-bookmark.php:28 includes/views/kind-favorite.php:28 +#: includes/views/kind-jam.php:26 includes/views/kind-like.php:28 +#: includes/views/kind-listen.php:26 includes/views/kind-watch.php:26 #: includes/views/kind.php:69 msgid "by" msgstr "" +#: includes/views/kind-jam.php:29 includes/views/kind-listen.php:29 +#: includes/views/kind-watch.php:29 +msgid " from " +msgstr "" + #: includes/views/kind.php:77 msgid "Duration: " msgstr "" @@ -362,473 +422,473 @@ msgctxt "indieweb-post-kinds" msgid "this" msgstr "" -#: includes/class-kind-taxonomy.php:55 +#: includes/class-kind-taxonomy.php:54 msgctxt "indieweb-post-kinds" msgid "Kinds" msgstr "" -#: includes/class-kind-taxonomy.php:56 +#: includes/class-kind-taxonomy.php:55 msgctxt "indieweb-post-kinds" msgid "Kind" msgstr "" -#: includes/class-kind-taxonomy.php:57 +#: includes/class-kind-taxonomy.php:56 msgctxt "indieweb-post-kinds" msgid "Search Kinds" msgstr "" -#: includes/class-kind-taxonomy.php:58 +#: includes/class-kind-taxonomy.php:57 msgctxt "indieweb-post-kinds" msgid "Popular Kinds" msgstr "" -#: includes/class-kind-taxonomy.php:59 +#: includes/class-kind-taxonomy.php:58 msgctxt "indieweb-post-kinds" msgid "All Kinds" msgstr "" -#: includes/class-kind-taxonomy.php:60 +#: includes/class-kind-taxonomy.php:59 msgctxt "indieweb-post-kinds" msgid "Parent Kind" msgstr "" -#: includes/class-kind-taxonomy.php:61 +#: includes/class-kind-taxonomy.php:60 msgctxt "indieweb-post-kinds" msgid "Parent Kind:" msgstr "" -#: includes/class-kind-taxonomy.php:62 +#: includes/class-kind-taxonomy.php:61 msgctxt "indieweb-post-kinds" msgid "Edit Kind" msgstr "" -#: includes/class-kind-taxonomy.php:63 +#: includes/class-kind-taxonomy.php:62 msgctxt "indieweb-post-kinds" msgid "View Kind" msgstr "" -#: includes/class-kind-taxonomy.php:64 +#: includes/class-kind-taxonomy.php:63 msgctxt "indieweb-post-kinds" msgid "Update Kind" msgstr "" -#: includes/class-kind-taxonomy.php:65 +#: includes/class-kind-taxonomy.php:64 msgctxt "indieweb-post-kinds" msgid "Add New Kind" msgstr "" -#: includes/class-kind-taxonomy.php:66 +#: includes/class-kind-taxonomy.php:65 msgctxt "indieweb-post-kinds" msgid "New Kind" msgstr "" -#: includes/class-kind-taxonomy.php:67 +#: includes/class-kind-taxonomy.php:66 msgctxt "indieweb-post-kinds" msgid "Separate kinds with commas" msgstr "" -#: includes/class-kind-taxonomy.php:68 +#: includes/class-kind-taxonomy.php:67 msgctxt "indieweb-post-kinds" msgid "Add or remove kinds" msgstr "" -#: includes/class-kind-taxonomy.php:69 +#: includes/class-kind-taxonomy.php:68 msgctxt "indieweb-post-kinds" msgid "Choose from the most used kinds" msgstr "" -#: includes/class-kind-taxonomy.php:70 +#: includes/class-kind-taxonomy.php:69 msgctxt "indieweb-post-kinds" msgid "No kinds found" msgstr "" -#: includes/class-kind-taxonomy.php:71 +#: includes/class-kind-taxonomy.php:70 msgctxt "indieweb-post-kinds" msgid "No kinds" msgstr "" -#: includes/class-kind-taxonomy.php:202 +#: includes/class-kind-taxonomy.php:201 msgctxt "indieweb-post-kinds" msgid "Article" msgstr "" -#: includes/class-kind-taxonomy.php:203 +#: includes/class-kind-taxonomy.php:202 msgctxt "indieweb-post-kinds" msgid "Articles" msgstr "" -#: includes/class-kind-taxonomy.php:204 includes/class-kind-taxonomy.php:213 -#: includes/class-kind-taxonomy.php:267 includes/class-kind-taxonomy.php:339 +#: includes/class-kind-taxonomy.php:203 includes/class-kind-taxonomy.php:212 +#: includes/class-kind-taxonomy.php:266 includes/class-kind-taxonomy.php:338 msgctxt "indieweb-post-kinds" msgid " " msgstr "" -#: includes/class-kind-taxonomy.php:211 +#: includes/class-kind-taxonomy.php:210 msgctxt "indieweb-post-kinds" msgid "Note" msgstr "" -#: includes/class-kind-taxonomy.php:212 +#: includes/class-kind-taxonomy.php:211 msgctxt "indieweb-post-kinds" msgid "Notes" msgstr "" -#: includes/class-kind-taxonomy.php:220 +#: includes/class-kind-taxonomy.php:219 msgctxt "indieweb-post-kinds" msgid "Reply" msgstr "" -#: includes/class-kind-taxonomy.php:221 +#: includes/class-kind-taxonomy.php:220 msgctxt "indieweb-post-kinds" msgid "Replies" msgstr "" -#: includes/class-kind-taxonomy.php:222 +#: includes/class-kind-taxonomy.php:221 msgctxt "indieweb-post-kinds" msgid "Replied" msgstr "" -#: includes/class-kind-taxonomy.php:229 +#: includes/class-kind-taxonomy.php:228 msgctxt "indieweb-post-kinds" msgid "Repost" msgstr "" -#: includes/class-kind-taxonomy.php:230 +#: includes/class-kind-taxonomy.php:229 msgctxt "indieweb-post-kinds" msgid "Reposts" msgstr "" -#: includes/class-kind-taxonomy.php:231 +#: includes/class-kind-taxonomy.php:230 msgctxt "indieweb-post-kinds" msgid "Reposted" msgstr "" -#: includes/class-kind-taxonomy.php:238 +#: includes/class-kind-taxonomy.php:237 msgctxt "indieweb-post-kinds" msgid "Like" msgstr "" -#: includes/class-kind-taxonomy.php:239 +#: includes/class-kind-taxonomy.php:238 msgctxt "indieweb-post-kinds" msgid "Likes" msgstr "" -#: includes/class-kind-taxonomy.php:240 +#: includes/class-kind-taxonomy.php:239 msgctxt "indieweb-post-kinds" msgid "Liked" msgstr "" -#: includes/class-kind-taxonomy.php:247 +#: includes/class-kind-taxonomy.php:246 msgctxt "indieweb-post-kinds" msgid "Favorite" msgstr "" -#: includes/class-kind-taxonomy.php:248 +#: includes/class-kind-taxonomy.php:247 msgctxt "indieweb-post-kinds" msgid "Favorites" msgstr "" -#: includes/class-kind-taxonomy.php:249 +#: includes/class-kind-taxonomy.php:248 msgctxt "indieweb-post-kinds" msgid "Favorited" msgstr "" -#: includes/class-kind-taxonomy.php:256 +#: includes/class-kind-taxonomy.php:255 msgctxt "indieweb-post-kinds" msgid "Bookmark" msgstr "" -#: includes/class-kind-taxonomy.php:257 +#: includes/class-kind-taxonomy.php:256 msgctxt "indieweb-post-kinds" msgid "Bookmarks" msgstr "" -#: includes/class-kind-taxonomy.php:258 +#: includes/class-kind-taxonomy.php:257 msgctxt "indieweb-post-kinds" msgid "Bookmarked" msgstr "" -#: includes/class-kind-taxonomy.php:265 +#: includes/class-kind-taxonomy.php:264 msgctxt "indieweb-post-kinds" msgid "Photo" msgstr "" -#: includes/class-kind-taxonomy.php:266 +#: includes/class-kind-taxonomy.php:265 msgctxt "indieweb-post-kinds" msgid "Photos" msgstr "" -#: includes/class-kind-taxonomy.php:274 +#: includes/class-kind-taxonomy.php:273 msgctxt "indieweb-post-kinds" msgid "Tag" msgstr "" -#: includes/class-kind-taxonomy.php:275 +#: includes/class-kind-taxonomy.php:274 msgctxt "indieweb-post-kinds" msgid "Tags" msgstr "" -#: includes/class-kind-taxonomy.php:276 +#: includes/class-kind-taxonomy.php:275 msgctxt "indieweb-post-kinds" msgid "Tagged" msgstr "" -#: includes/class-kind-taxonomy.php:283 +#: includes/class-kind-taxonomy.php:282 msgctxt "indieweb-post-kinds" msgid "RSVP" msgstr "" -#: includes/class-kind-taxonomy.php:284 +#: includes/class-kind-taxonomy.php:283 msgctxt "indieweb-post-kinds" msgid "RSVPs" msgstr "" -#: includes/class-kind-taxonomy.php:285 +#: includes/class-kind-taxonomy.php:284 msgctxt "indieweb-post-kinds" msgid "RSVPed" msgstr "" -#: includes/class-kind-taxonomy.php:292 +#: includes/class-kind-taxonomy.php:291 msgctxt "indieweb-post-kinds" msgid "Listen" msgstr "" -#: includes/class-kind-taxonomy.php:293 +#: includes/class-kind-taxonomy.php:292 msgctxt "indieweb-post-kinds" msgid "Listens" msgstr "" -#: includes/class-kind-taxonomy.php:294 +#: includes/class-kind-taxonomy.php:293 msgctxt "indieweb-post-kinds" msgid "Listened" msgstr "" -#: includes/class-kind-taxonomy.php:301 +#: includes/class-kind-taxonomy.php:300 msgctxt "indieweb-post-kinds" msgid "Watch" msgstr "" -#: includes/class-kind-taxonomy.php:302 +#: includes/class-kind-taxonomy.php:301 msgctxt "indieweb-post-kinds" msgid "Watches" msgstr "" -#: includes/class-kind-taxonomy.php:303 +#: includes/class-kind-taxonomy.php:302 msgctxt "indieweb-post-kinds" msgid "Watched" msgstr "" -#: includes/class-kind-taxonomy.php:310 +#: includes/class-kind-taxonomy.php:309 msgctxt "indieweb-post-kinds" msgid "Checkin" msgstr "" -#: includes/class-kind-taxonomy.php:311 +#: includes/class-kind-taxonomy.php:310 msgctxt "indieweb-post-kinds" msgid "Checkins" msgstr "" -#: includes/class-kind-taxonomy.php:312 +#: includes/class-kind-taxonomy.php:311 msgctxt "indieweb-post-kinds" msgid "Checked into" msgstr "" -#: includes/class-kind-taxonomy.php:319 +#: includes/class-kind-taxonomy.php:318 msgctxt "indieweb-post-kinds" msgid "Wish" msgstr "" -#: includes/class-kind-taxonomy.php:320 +#: includes/class-kind-taxonomy.php:319 msgctxt "indieweb-post-kinds" msgid "Wishes" msgstr "" -#: includes/class-kind-taxonomy.php:321 +#: includes/class-kind-taxonomy.php:320 msgctxt "indieweb-post-kinds" msgid "Wished" msgstr "" -#: includes/class-kind-taxonomy.php:328 +#: includes/class-kind-taxonomy.php:327 msgctxt "indieweb-post-kinds" msgid "Play" msgstr "" -#: includes/class-kind-taxonomy.php:329 +#: includes/class-kind-taxonomy.php:328 msgctxt "indieweb-post-kinds" msgid "Playing" msgstr "" -#: includes/class-kind-taxonomy.php:330 +#: includes/class-kind-taxonomy.php:329 msgctxt "indieweb-post-kinds" msgid "Played" msgstr "" -#: includes/class-kind-taxonomy.php:337 includes/class-kind-taxonomy.php:338 +#: includes/class-kind-taxonomy.php:336 includes/class-kind-taxonomy.php:337 msgctxt "indieweb-post-kinds" msgid "Weather" msgstr "" -#: includes/class-kind-taxonomy.php:346 includes/class-kind-taxonomy.php:347 +#: includes/class-kind-taxonomy.php:345 includes/class-kind-taxonomy.php:346 msgctxt "indieweb-post-kinds" msgid "Exercise" msgstr "" -#: includes/class-kind-taxonomy.php:348 +#: includes/class-kind-taxonomy.php:347 msgctxt "indieweb-post-kinds" msgid "Exercised" msgstr "" -#: includes/class-kind-taxonomy.php:355 +#: includes/class-kind-taxonomy.php:354 msgctxt "indieweb-post-kinds" msgid "Trip" msgstr "" -#: includes/class-kind-taxonomy.php:356 +#: includes/class-kind-taxonomy.php:355 msgctxt "indieweb-post-kinds" msgid "Trips" msgstr "" -#: includes/class-kind-taxonomy.php:357 includes/class-kind-taxonomy.php:366 +#: includes/class-kind-taxonomy.php:356 includes/class-kind-taxonomy.php:365 msgctxt "indieweb-post-kinds" msgid "Travelled" msgstr "" -#: includes/class-kind-taxonomy.php:364 +#: includes/class-kind-taxonomy.php:363 msgctxt "indieweb-post-kinds" msgid "Itinerary" msgstr "" -#: includes/class-kind-taxonomy.php:365 +#: includes/class-kind-taxonomy.php:364 msgctxt "indieweb-post-kinds" msgid "Itineraries" msgstr "" -#: includes/class-kind-taxonomy.php:373 includes/class-kind-taxonomy.php:374 +#: includes/class-kind-taxonomy.php:372 includes/class-kind-taxonomy.php:373 msgctxt "indieweb-post-kinds" msgid "Eat" msgstr "" -#: includes/class-kind-taxonomy.php:375 +#: includes/class-kind-taxonomy.php:374 msgctxt "indieweb-post-kinds" msgid "Ate" msgstr "" -#: includes/class-kind-taxonomy.php:382 +#: includes/class-kind-taxonomy.php:381 msgctxt "indieweb-post-kinds" msgid "Drink" msgstr "" -#: includes/class-kind-taxonomy.php:383 +#: includes/class-kind-taxonomy.php:382 msgctxt "indieweb-post-kinds" msgid "Drinks" msgstr "" -#: includes/class-kind-taxonomy.php:384 +#: includes/class-kind-taxonomy.php:383 msgctxt "indieweb-post-kinds" msgid "Drank" msgstr "" -#: includes/class-kind-taxonomy.php:391 +#: includes/class-kind-taxonomy.php:390 msgctxt "indieweb-post-kinds" msgid "Follow" msgstr "" -#: includes/class-kind-taxonomy.php:392 +#: includes/class-kind-taxonomy.php:391 msgctxt "indieweb-post-kinds" msgid "Follows" msgstr "" -#: includes/class-kind-taxonomy.php:393 +#: includes/class-kind-taxonomy.php:392 msgctxt "indieweb-post-kinds" msgid "Followed" msgstr "" -#: includes/class-kind-taxonomy.php:400 +#: includes/class-kind-taxonomy.php:399 msgctxt "indieweb-post-kinds" msgid "Jam" msgstr "" -#: includes/class-kind-taxonomy.php:401 +#: includes/class-kind-taxonomy.php:400 msgctxt "indieweb-post-kinds" msgid "Jams" msgstr "" -#: includes/class-kind-taxonomy.php:402 +#: includes/class-kind-taxonomy.php:401 msgctxt "indieweb-post-kinds" msgid "Listened to" msgstr "" -#: includes/class-kind-taxonomy.php:409 includes/class-kind-taxonomy.php:411 +#: includes/class-kind-taxonomy.php:408 includes/class-kind-taxonomy.php:410 msgctxt "indieweb-post-kinds" msgid "Read" msgstr "" -#: includes/class-kind-taxonomy.php:410 +#: includes/class-kind-taxonomy.php:409 msgctxt "indieweb-post-kinds" msgid "Reads" msgstr "" -#: includes/class-kind-taxonomy.php:418 +#: includes/class-kind-taxonomy.php:417 msgctxt "indieweb-post-kinds" msgid "Quote" msgstr "" -#: includes/class-kind-taxonomy.php:419 +#: includes/class-kind-taxonomy.php:418 msgctxt "indieweb-post-kinds" msgid "Quotes" msgstr "" -#: includes/class-kind-taxonomy.php:420 +#: includes/class-kind-taxonomy.php:419 msgctxt "indieweb-post-kinds" msgid "Quoted" msgstr "" -#: includes/class-kind-taxonomy.php:427 +#: includes/class-kind-taxonomy.php:426 msgctxt "indieweb-post-kinds" msgid "Mood" msgstr "" -#: includes/class-kind-taxonomy.php:428 +#: includes/class-kind-taxonomy.php:427 msgctxt "indieweb-post-kinds" msgid "Moods" msgstr "" -#: includes/class-kind-taxonomy.php:429 +#: includes/class-kind-taxonomy.php:428 msgctxt "indieweb-post-kinds" msgid "Felt" msgstr "" -#: includes/class-kind-taxonomy.php:436 +#: includes/class-kind-taxonomy.php:435 msgctxt "indieweb-post-kinds" msgid "Recipe" msgstr "" -#: includes/class-kind-taxonomy.php:437 +#: includes/class-kind-taxonomy.php:436 msgctxt "indieweb-post-kinds" msgid "Recipes" msgstr "" -#: includes/class-kind-taxonomy.php:438 +#: includes/class-kind-taxonomy.php:437 msgctxt "indieweb-post-kinds" msgid "Cooked" msgstr "" -#: includes/class-kind-view.php:147 +#: includes/class-kind-view.php:150 msgctxt "indieweb-post-kinds" msgid "a tweet" msgstr "" -#: includes/class-kind-view.php:148 includes/class-kind-view.php:149 +#: includes/class-kind-view.php:151 includes/class-kind-view.php:152 msgctxt "indieweb-post-kinds" msgid "a video" msgstr "" -#: includes/class-kind-view.php:150 +#: includes/class-kind-view.php:153 msgctxt "indieweb-post-kinds" msgid "an image" msgstr "" -#: includes/class-kind-view.php:156 +#: includes/class-kind-view.php:159 msgctxt "indieweb-post-kinds" msgid "a post" msgstr "" \ No newline at end of file diff --git a/readme.md b/readme.md index 3208431..cb0069a 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,9 @@ # Post Kinds # **Contributors:** dshanske **Tags:** indieweb, interaction, posts, webmention, share, like -**Stable tag:** 2.5.2 +**Stable tag:** 2.6.0 **Requires at least:** 4.7 -**Tested up to:** 4.7.2 +**Tested up to:** 4.8 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -92,7 +92,7 @@ may make it a Passive Kind. * **Article** - traditional long form content - a post with an explicit post name(title) * **Note** - short content - a post with just plain content (also the default) - * **Photo** - image or photo post - a post with an embedded image as its primary focus + * **Photo** - image or photo post - a post with an embedded image as its primary focus. This uses either the featured image or attached images ### The Response Kinds ### @@ -103,6 +103,7 @@ may make it a Passive Kind. * **Bookmark** - This is basically sharing/storing a link/bookmark. * **Quote** - Quoted Content * **RSVP** - A specific type of Reply regarding an event + ### The Passive Kinds ### To "Scrobble" a song is when listening to it, you would make it a post on @@ -150,14 +151,32 @@ Post Kinds also automatically handles RSS feeds which can be made available or s * If you add `?kindurl=URL` to the post editor URL, it will automatically fill this into the URL box in post properties * If you add `?kind=like` to the post editor URL, it will automatically set the kind. -So - `https://www.example.com/wp-admin/post-new.php?kindurl=URL&kind=like` will automatically set a like with the URL URL +So - `https://www.example.com/wp-admin/post-new.php?kindurl=URL&kind=like` will automatically set a like with the URL ## SNAP ## -Indieweb Post Kinds had support for replying to Twitter posts using the Social Network Auto Poster plugin. The developers of that plugin have not contacted the +Post Kinds had support for replying to Twitter posts using the Social Network Auto Poster plugin. The developers of that plugin have not contacted the developer of this plugin. +## Theme Support ## + +Post Kinds automatically adds information to `the_content` and `the_excerpt` filter. Being as this is inside the content block, which may or may not be desirable, you may remove these filters as noted +below and call `kind_display` directly. This will allow it to appear outside the content block. + * `remove_filter( 'the_content', array( 'Kind_View', 'content_response' ), 20 );` + * `remove_filter( 'the_excerpt', array( 'Kind_View', 'excerpt_response' ), 20 );` + +The functions `has_post_kind`, `set_post_kind`, and `set_post_kind` will allow you to manipulate the kind settings in a post. `get_post_kind_string` will return the display name of a kind. + + ## Changelog ## + = Version 2.6.0 = + * Remove h-as properties + * Add basic templates for some different kinds + * Improve duration display + * If post_ID not passed to display function will use get_the_ID + * Remove mf2 CSS from being styled + * Allow for child themes to add kind templates + * Photo post will now use either featured image or gallery of attached media automatically. = Version 2.5.2 = * Generation of strings being moved from individual functions to one unified function to make management easier * Description now appears on Archives diff --git a/readme.txt b/readme.txt index 4628d9d..ab2a5ac 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ === Post Kinds === Contributors: dshanske Tags: indieweb, interaction, posts, webmention, share, like -Stable tag: 2.5.2 +Stable tag: 2.6.0 Requires at least: 4.7 -Tested up to: 4.7.2 +Tested up to: 4.8 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -88,7 +88,7 @@ may make it a Passive Kind. * **Article** - traditional long form content - a post with an explicit post name(title) * **Note** - short content - a post with just plain content (also the default) - * **Photo** - image or photo post - a post with an embedded image as its primary focus + * **Photo** - image or photo post - a post with an embedded image as its primary focus. This uses either the featured image or attached images = The Response Kinds = @@ -99,6 +99,7 @@ may make it a Passive Kind. * **Bookmark** - This is basically sharing/storing a link/bookmark. * **Quote** - Quoted Content * **RSVP** - A specific type of Reply regarding an event + = The Passive Kinds = To "Scrobble" a song is when listening to it, you would make it a post on @@ -146,14 +147,32 @@ Post Kinds also automatically handles RSS feeds which can be made available or s * If you add `?kindurl=URL` to the post editor URL, it will automatically fill this into the URL box in post properties * If you add `?kind=like` to the post editor URL, it will automatically set the kind. -So - `https://www.example.com/wp-admin/post-new.php?kindurl=URL&kind=like` will automatically set a like with the URL URL +So - `https://www.example.com/wp-admin/post-new.php?kindurl=URL&kind=like` will automatically set a like with the URL == SNAP == -Indieweb Post Kinds had support for replying to Twitter posts using the Social Network Auto Poster plugin. The developers of that plugin have not contacted the +Post Kinds had support for replying to Twitter posts using the Social Network Auto Poster plugin. The developers of that plugin have not contacted the developer of this plugin. +== Theme Support == + +Post Kinds automatically adds information to `the_content` and `the_excerpt` filter. Being as this is inside the content block, which may or may not be desirable, you may remove these filters as noted +below and call `kind_display` directly. This will allow it to appear outside the content block. + * `remove_filter( 'the_content', array( 'Kind_View', 'content_response' ), 20 );` + * `remove_filter( 'the_excerpt', array( 'Kind_View', 'excerpt_response' ), 20 );` + +The functions `has_post_kind`, `set_post_kind`, and `set_post_kind` will allow you to manipulate the kind settings in a post. `get_post_kind_string` will return the display name of a kind. + + == Changelog == + = Version 2.6.0 = + * Remove h-as properties + * Add basic templates for some different kinds + * Improve duration display + * If post_ID not passed to display function will use get_the_ID + * Remove mf2 CSS from being styled + * Allow for child themes to add kind templates + * Photo post will now use either featured image or gallery of attached media automatically. = Version 2.5.2 = * Generation of strings being moved from individual functions to one unified function to make management easier * Description now appears on Archives diff --git a/sass/_frontend.scss b/sass/_frontend.scss index 32a3418..35ed879 100755 --- a/sass/_frontend.scss +++ b/sass/_frontend.scss @@ -12,15 +12,15 @@ margin-left: 25px; } - .u-url:link { + a:link { text-decoration: none; } - .u-url:hover { + a:hover { text-decoration: none; } - .u-photo, .u-featured { + img { padding: 0; margin: 2px; } @@ -31,7 +31,7 @@ ul.cites { display: inline; } -.embeds { +.kind-embeds { text-align: center; position: relative; width: 100%;