diff --git a/composer.lock b/composer.lock index b881b59e..1078009a 100644 --- a/composer.lock +++ b/composer.lock @@ -677,16 +677,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.31", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "15524571ae0686a7facc2eb1f40f600e5bbce9e5" + "reference": "77b3e2003fd4446b35826cb9dc397129c521c888" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/15524571ae0686a7facc2eb1f40f600e5bbce9e5", - "reference": "15524571ae0686a7facc2eb1f40f600e5bbce9e5", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/77b3e2003fd4446b35826cb9dc397129c521c888", + "reference": "77b3e2003fd4446b35826cb9dc397129c521c888", "shasum": "" }, "require": { @@ -749,11 +749,11 @@ { "name": "Michael Bodnarchuk", "email": "davert@mail.ua", - "homepage": "http://codegyre.com" + "homepage": "https://codegyre.com" } ], "description": "BDD-style testing framework", - "homepage": "http://codeception.com/", + "homepage": "https://codeception.com/", "keywords": [ "BDD", "TDD", @@ -763,7 +763,7 @@ ], "support": { "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.1.31" + "source": "https://github.com/Codeception/Codeception/tree/4.2.1" }, "funding": [ { @@ -771,7 +771,7 @@ "type": "open_collective" } ], - "time": "2022-03-13T17:07:08+00:00" + "time": "2022-06-22T06:18:59+00:00" }, { "name": "codeception/lib-asserts", @@ -1653,16 +1653,16 @@ }, { "name": "consolidation/annotated-command", - "version": "4.5.5", + "version": "4.5.6", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "67cea8e8e7656b74da651ea6f49321853996c0fd" + "reference": "3968070538761628546270935f0733a0cc408e1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/67cea8e8e7656b74da651ea6f49321853996c0fd", - "reference": "67cea8e8e7656b74da651ea6f49321853996c0fd", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/3968070538761628546270935f0733a0cc408e1f", + "reference": "3968070538761628546270935f0733a0cc408e1f", "shasum": "" }, "require": { @@ -1703,22 +1703,22 @@ "description": "Initialize Symfony Console commands from annotated command class methods.", "support": { "issues": "https://github.com/consolidation/annotated-command/issues", - "source": "https://github.com/consolidation/annotated-command/tree/4.5.5" + "source": "https://github.com/consolidation/annotated-command/tree/4.5.6" }, - "time": "2022-04-26T16:18:25+00:00" + "time": "2022-06-22T20:17:12+00:00" }, { "name": "consolidation/config", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "0c15841b2bf60d9af1ce29884673e7d9d50c3b75" + "reference": "dae810c162f0e799ea3f35cc2f40b0797b6e4d26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/0c15841b2bf60d9af1ce29884673e7d9d50c3b75", - "reference": "0c15841b2bf60d9af1ce29884673e7d9d50c3b75", + "url": "https://api.github.com/repos/consolidation/config/zipball/dae810c162f0e799ea3f35cc2f40b0797b6e4d26", + "reference": "dae810c162f0e799ea3f35cc2f40b0797b6e4d26", "shasum": "" }, "require": { @@ -1763,9 +1763,9 @@ "description": "Provide configuration services for a commandline tool.", "support": { "issues": "https://github.com/consolidation/config/issues", - "source": "https://github.com/consolidation/config/tree/2.1.0" + "source": "https://github.com/consolidation/config/tree/2.1.1" }, - "time": "2022-02-24T00:32:42+00:00" + "time": "2022-06-22T19:59:34+00:00" }, { "name": "consolidation/log", @@ -2652,22 +2652,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.4", + "version": "7.4.5", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8" + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8", - "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/psr7": "^1.9 || ^2.4", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -2756,7 +2756,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.4" + "source": "https://github.com/guzzle/guzzle/tree/7.4.5" }, "funding": [ { @@ -2772,7 +2772,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T21:39:15+00:00" + "time": "2022-06-20T22:16:13+00:00" }, { "name": "guzzlehttp/promises", @@ -2860,16 +2860,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.3.0", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee" + "reference": "13388f00956b1503577598873fffb5ae994b5737" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/83260bb50b8fc753c72d14dc1621a2dac31877ee", - "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", + "reference": "13388f00956b1503577598873fffb5ae994b5737", "shasum": "" }, "require": { @@ -2893,7 +2893,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } }, "autoload": { @@ -2955,7 +2955,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.3.0" + "source": "https://github.com/guzzle/psr7/tree/2.4.0" }, "funding": [ { @@ -2971,7 +2971,7 @@ "type": "tidelift" } ], - "time": "2022-06-09T08:26:02+00:00" + "time": "2022-06-20T21:43:11+00:00" }, { "name": "hoa/consistency", @@ -3605,16 +3605,16 @@ }, { "name": "illuminate/collections", - "version": "v8.83.16", + "version": "v8.83.17", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "fc232e89c0214dba5d2b431220a24b02d480a472" + "reference": "71cc806cf214a287dd4a86cac09171a84c3aa573" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/fc232e89c0214dba5d2b431220a24b02d480a472", - "reference": "fc232e89c0214dba5d2b431220a24b02d480a472", + "url": "https://api.github.com/repos/illuminate/collections/zipball/71cc806cf214a287dd4a86cac09171a84c3aa573", + "reference": "71cc806cf214a287dd4a86cac09171a84c3aa573", "shasum": "" }, "require": { @@ -3655,11 +3655,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-03-25T14:53:23+00:00" + "time": "2022-06-17T02:35:16+00:00" }, { "name": "illuminate/contracts", - "version": "v8.83.16", + "version": "v8.83.17", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -3707,7 +3707,7 @@ }, { "name": "illuminate/macroable", - "version": "v8.83.16", + "version": "v8.83.17", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -3753,7 +3753,7 @@ }, { "name": "illuminate/support", - "version": "v8.83.16", + "version": "v8.83.17", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", @@ -4385,16 +4385,16 @@ }, { "name": "nelexa/zip", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/Ne-Lexa/php-zip.git", - "reference": "a18f80db509b1b6e9798e2745dc100759107f50c" + "reference": "88a1b6549be813278ff2dd3b6b2ac188827634a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ne-Lexa/php-zip/zipball/a18f80db509b1b6e9798e2745dc100759107f50c", - "reference": "a18f80db509b1b6e9798e2745dc100759107f50c", + "url": "https://api.github.com/repos/Ne-Lexa/php-zip/zipball/88a1b6549be813278ff2dd3b6b2ac188827634a7", + "reference": "88a1b6549be813278ff2dd3b6b2ac188827634a7", "shasum": "" }, "require": { @@ -4452,9 +4452,9 @@ ], "support": { "issues": "https://github.com/Ne-Lexa/php-zip/issues", - "source": "https://github.com/Ne-Lexa/php-zip/tree/4.0.1" + "source": "https://github.com/Ne-Lexa/php-zip/tree/4.0.2" }, - "time": "2021-12-12T09:50:45+00:00" + "time": "2022-06-17T11:17:46+00:00" }, { "name": "nesbot/carbon", @@ -7113,16 +7113,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.2", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", - "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", "shasum": "" }, "require": { @@ -7165,7 +7165,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-12-12T21:44:58+00:00" + "time": "2022-06-18T07:21:10+00:00" }, { "name": "symfony/browser-kit", @@ -7320,16 +7320,16 @@ }, { "name": "symfony/console", - "version": "v5.4.9", + "version": "v5.4.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb" + "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/829d5d1bf60b2efeb0887b7436873becc71a45eb", - "reference": "829d5d1bf60b2efeb0887b7436873becc71a45eb", + "url": "https://api.github.com/repos/symfony/console/zipball/4d671ab4ddac94ee439ea73649c69d9d200b5000", + "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000", "shasum": "" }, "require": { @@ -7399,7 +7399,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.9" + "source": "https://github.com/symfony/console/tree/v5.4.10" }, "funding": [ { @@ -7415,7 +7415,7 @@ "type": "tidelift" } ], - "time": "2022-05-18T06:17:34+00:00" + "time": "2022-06-26T13:00:04+00:00" }, { "name": "symfony/css-selector", @@ -8635,16 +8635,16 @@ }, { "name": "symfony/string", - "version": "v5.4.9", + "version": "v5.4.10", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99" + "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", - "reference": "985e6a9703ef5ce32ba617c9c7d97873bb7b2a99", + "url": "https://api.github.com/repos/symfony/string/zipball/4432bc7df82a554b3e413a8570ce2fea90e94097", + "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097", "shasum": "" }, "require": { @@ -8701,7 +8701,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.9" + "source": "https://github.com/symfony/string/tree/v5.4.10" }, "funding": [ { @@ -8717,7 +8717,7 @@ "type": "tidelift" } ], - "time": "2022-04-19T10:40:37+00:00" + "time": "2022-06-26T15:57:47+00:00" }, { "name": "symfony/translation", @@ -8896,16 +8896,16 @@ }, { "name": "symfony/yaml", - "version": "v5.4.3", + "version": "v5.4.10", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2" + "reference": "04e42926429d9e8b39c174387ab990bf7817f7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2", + "url": "https://api.github.com/repos/symfony/yaml/zipball/04e42926429d9e8b39c174387ab990bf7817f7a2", + "reference": "04e42926429d9e8b39c174387ab990bf7817f7a2", "shasum": "" }, "require": { @@ -8951,7 +8951,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.3" + "source": "https://github.com/symfony/yaml/tree/v5.4.10" }, "funding": [ { @@ -8967,7 +8967,7 @@ "type": "tidelift" } ], - "time": "2022-01-26T16:32:32+00:00" + "time": "2022-06-20T11:50:59+00:00" }, { "name": "theseer/fdomdocument", diff --git a/defines.php b/defines.php index 8e0bbdad..865ebe8a 100644 --- a/defines.php +++ b/defines.php @@ -12,7 +12,7 @@ defined('ABSPATH') or die('No direct script access allowed.'); if (!defined('PP_AUTHORS_LOADED')) { - define('PP_AUTHORS_VERSION', '3.18.0'); + define('PP_AUTHORS_VERSION', '3.19.0'); define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php'); define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php')); define('PP_AUTHORS_MODULES_PATH', PP_AUTHORS_BASE_PATH . 'src/modules/'); diff --git a/package-lock.json b/package-lock.json index e4bf19ec..9f21c5a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7228,9 +7228,9 @@ } }, "node_modules/jpeg-js": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.3.tgz", - "integrity": "sha512-ru1HWKek8octvUHFHvE5ZzQ1yAsJmIvRdGWvSoKV52XKyuyYA437QWDttXT8eZXDSbuMpHlLzPDZUPd6idIz+Q==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", "dev": true }, "node_modules/js-beautify": { @@ -17679,9 +17679,9 @@ } }, "jpeg-js": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.3.tgz", - "integrity": "sha512-ru1HWKek8octvUHFHvE5ZzQ1yAsJmIvRdGWvSoKV52XKyuyYA437QWDttXT8eZXDSbuMpHlLzPDZUPd6idIz+Q==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", "dev": true }, "js-beautify": { diff --git a/publishpress-authors.php b/publishpress-authors.php index d4d8d8dc..06210b0d 100644 --- a/publishpress-authors.php +++ b/publishpress-authors.php @@ -5,7 +5,7 @@ * Description: PublishPress Authors allows you to add multiple authors and guest authors to WordPress posts * Author: PublishPress * Author URI: https://publishpress.com - * Version: 3.18.0 + * Version: 3.19.0 * Text Domain: publishpress-authors * * ------------------------------------------------------------------------------ diff --git a/readme.txt b/readme.txt index 827415ed..e91d5ead 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: multiple authors, authors, guest authors, author fields, author layouts Requires at least: 4.7 Requires PHP: 5.6 Tested up to: 6.0 -Stable tag: 3.18.0 +Stable tag: 3.19.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -224,6 +224,13 @@ There are two ways to install the PublishPress Authors plugin: == Changelog == += [3.19.0] - 27 Jun 2022 = + +* Feature: Added new Author Profile Pages, #417 +* Added: Settings tab for "Author Pages", #729 +* Update: Authors taxonomy queries improvement, #527 +* Added: Added filter to authors rest response, #726 + = [3.18.0] - 13 Jun 2022 = * Fixed: Allow authors to have the same name, #682 diff --git a/src/assets/css/multiple-authors-page.css b/src/assets/css/multiple-authors-page.css new file mode 100644 index 00000000..14f60a8b --- /dev/null +++ b/src/assets/css/multiple-authors-page.css @@ -0,0 +1,298 @@ +body.tax-author .ast-container { + display: block; +} + +.ppma-page-header { + padding-bottom: 10px; +} + +.ppma-page-header .ppma-page-title { + margin-top: 5px; +} + +.ppma-page-content.list .ppma-article { + word-break: break-word; + position: relative; + margin: 0 0 20px; +} + +.ppma-page-content.list a:not(.read-more):not(.page-numbers) { + margin: 0; + padding: 0; + vertical-align: baseline; +} + +.ppma-page-content.list .article-content { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: start; + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + margin-bottom: 20px; +} + +.ppma-page-content.list .article-image { + position: relative; + width: 27%; + margin-right: 0; +} + +.ppma-page-content.list .featured-image-link { + display: block; + position: relative; + width: 100%; + background: transparent url('../img/no-image.jpeg'); + vertical-align: top; + background-repeat: no-repeat; + background-position: center center; + background-size: cover; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + height: 100%; + transition: transform .3s ease,opacity .3s; + transition-timing-function: cubic-bezier(0.39,0.76,0.51,0.56); +} + +.ppma-page-content.list .featured-image-link:before { + display: block; + content: ""; + width: 100%; + padding-top: 66.6667%; + background: none!important; + box-shadow: none!important; +} + +.ppma-page-content.list .featured-image-link:after { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + z-index: 1; + transition: opacity .3s ease; +} +.ppma-page-content.list .article-image:hover .featured-image-link:after { + opacity: .3; +} + +.ppma-page-content.list .article-body { + padding-left: 20px; + flex: 1; +} + +.ppma-page-content.list .category-links { + overflow: hidden; + margin-bottom: 0; + display: inline-block; +} +.ppma-page-content.list.category-links a, +.ppma-page-content.list .category-links a { + float: left; + text-align: left; + transition: all .3s; + padding: 0 5px; + margin-right: 5px; + margin-bottom: 3px; +} + +.ppma-page-content.list .article-title { + text-align: left; + margin: 0; + margin-bottom: 4px; + clear: both; +} + +.ppma-page-content.list .article-meta-item { + display: inline; + margin-right: 10px; +} + +.ppma-page-content.list .article-meta .dashicons { + margin-right: 3px; + vertical-align: middle; +} + +.ppma-page-content.list .article-entry-excerpt { + margin: 1.5em 0 0; + margin-top: 9px; + text-align: left; +} + +.ppma-page-content.list .article-entry-excerpt:after { + content: ""; + display: table; + clear: both; +} + +.ppma-page-content.list .article-footer .tags-links { + display: inline-block; + margin: 10px -2.5px 5px; + width: 100%; +} + +.ppma-page-content.list .article-footer .tags-links a { + display: inline-block; + min-height: 24px; + text-align: left; + margin: 0 2.5px 5px; + padding-left: 10px; + padding-right: 10px; +} + +.ppma-page-content.list .no-featured-image .article-image { + display: none; +} + +.ppma-article-pagination { + clear: both; +} + +.ppma-page-content.grid a:not(.read-more):not(.page-numbers):not(.category-cat-name) { + margin: 0; + padding: 0; + vertical-align: baseline; +} + +.ppma-page-content.grid .ppma-article { + position: relative; + width: 23%; + float: left; + padding: 0; + padding-left: 10px; + padding-right: 10px; + margin-top: 20px; + margin-bottom: 0; + min-height: 500px; + word-break: break-word; +} + +.ppma-page-content.grid .ppma-article:last-of-type { + margin-bottom: 50px; +} + +.ppma-page-content.grid .ppma-grid-post-thumb { + position: relative; + overflow: hidden; + display: block; +} + +.ppma-page-content.grid .ppma-grid-post-thumb .ppma-grid-post-image-holder { + position: relative; + width: 100%; + background: transparent url('../img/no-image.jpeg'); + display: block; + vertical-align: top; + background-repeat: no-repeat; + background-position: center center; + background-size: cover; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + height: 100%; + transition: transform .3s ease,opacity .3s; + transition-timing-function: cubic-bezier(0.39,0.76,0.51,0.56); +} + +.ppma-page-content.grid .ppma-grid-post-image-holder:before { + display: block; + content: ""; + width: 100%; + padding-top: 66.6667%; + background: none!important; + box-shadow: none!important; +} + +.ppma-page-content.grid .ppma-grid-post-image-holder:after { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + z-index: 1; + transition: opacity .3s ease; +} + +.ppma-page-content.grid .ppma-grid-post-cat { + position: absolute; + top: 10px; + left: 10px; + z-index: 2; +} + +.ppma-page-content.grid .category-cat-name { + float: left; + display: inline-block; + padding: 0 5px; + line-height: 16px; + text-align: left; + margin-right: 5px; + margin-bottom: 5px; +} + +.ppma-page-content.grid .ppma-grid-post-title { + margin-top: 10px; + margin-bottom: 0; +} + +.ppma-page-content.grid .ppma-grid-post-meta { + margin-top: 5px; +} + +.ppma-page-content.grid .ppma-grid-post-meta .entry-meta-item:first-child { + padding-left: 1px; +} + +.ppma-page-content.grid .ppma-grid-post-meta .entry-meta-item, +.ppma-page-content.grid .ppma-grid-post-meta .entry-meta-item a { + display: inline-block; +} + + +.ppma-page-content.grid .ppma-grid-post-meta .dashicons { + margin-right: 3px; + vertical-align: middle; +} + +.ppma-page-content.grid .article-footer .tags-links { + display: inline-block; + margin: 10px -2.5px 5px; + width: 100%; +} + +.ppma-page-content.grid .article-footer .tags-links a { + display: inline-block; + text-align: left; + margin: 0 2.5px 5px; + padding-left: 10px; + padding-right: 10px; +} + +.ppma-page-content.grid .article-entry-excerpt, +.ppma-page-content.grid .article-entry-excerpt .read-more { + margin-bottom: 3px; + margin-top: 8px; +} + +.ppma-page-content.grid .article-entry-excerpt:after { + content: ""; + display: table; + clear: both; +} + +.ppma-page-content.grid .no-featured-image .ppma-grid-post-image-holder { + display: none; +} + +@media screen and (max-width: 768px) { + .ppma-page-content.grid .ppma-article { + width: 95%; + } +} \ No newline at end of file diff --git a/src/assets/img/no-image.jpeg b/src/assets/img/no-image.jpeg new file mode 100644 index 00000000..78c7ae09 Binary files /dev/null and b/src/assets/img/no-image.jpeg differ diff --git a/src/core/Classes/Content_Model.php b/src/core/Classes/Content_Model.php index 4b319c67..a9d6bae8 100644 --- a/src/core/Classes/Content_Model.php +++ b/src/core/Classes/Content_Model.php @@ -10,6 +10,7 @@ namespace MultipleAuthors\Classes; use MultipleAuthors\Classes\Objects\Author; +use MultipleAuthors\Factory; /** * Declaration of the content model @@ -51,15 +52,28 @@ public static function filter_term_link($link, $term, $taxonomy) return $link; } - $author = Author::get_by_term_id($term->term_id); - $author_slug = is_object($author) ? $author->slug : ''; - $permastruct = $wp_rewrite->get_author_permastruct(); + $legacyPlugin = Factory::getLegacyPlugin(); - if ($permastruct) { - $link = str_replace('%author%', $author_slug, $permastruct); - $link = home_url(user_trailingslashit($link)); + if (!empty($legacyPlugin) && isset($legacyPlugin->multiple_authors) + && isset($legacyPlugin->modules->multiple_authors->options->enable_plugin_author_pages) + && $legacyPlugin->modules->multiple_authors->options->enable_plugin_author_pages === 'yes' + ) { + $enable_authors_profile = true; } else { - $link = add_query_arg('author_name', rawurlencode($author_slug), home_url() . '/'); + $enable_authors_profile = false; + } + + if (!$enable_authors_profile) { + $author = Author::get_by_term_id($term->term_id); + $author_slug = is_object($author) ? $author->slug : ''; + $permastruct = $wp_rewrite->get_author_permastruct(); + + if ($permastruct) { + $link = str_replace('%author%', $author_slug, $permastruct); + $link = home_url(user_trailingslashit($link)); + } else { + $link = add_query_arg('author_name', rawurlencode($author_slug), home_url() . '/'); + } } return $link; @@ -77,9 +91,20 @@ public static function filter_author_link($link, $author_id) { global $wp_rewrite; + $legacyPlugin = Factory::getLegacyPlugin(); + + if (!empty($legacyPlugin) && isset($legacyPlugin->multiple_authors) + && isset($legacyPlugin->modules->multiple_authors->options->enable_plugin_author_pages) + && $legacyPlugin->modules->multiple_authors->options->enable_plugin_author_pages === 'yes' + ) { + $enable_authors_profile = true; + } else { + $enable_authors_profile = false; + } + $permastruct = $wp_rewrite->get_author_permastruct(); - if (empty($permastruct)) { + if (empty($permastruct) && !$enable_authors_profile) { return $link; } @@ -93,6 +118,13 @@ public static function filter_author_link($link, $author_id) } } + if ($enable_authors_profile) { + $author_data = Author::get_by_user_id($author_id); + if (is_object($author_data)) { + return get_term_link($author_data->term_id); + } + } + $link_path = str_replace(home_url(), '', $link); // Check if the author slug is empty in the link. diff --git a/src/core/Classes/Query.php b/src/core/Classes/Query.php index fb5f8fd4..17507c70 100644 --- a/src/core/Classes/Query.php +++ b/src/core/Classes/Query.php @@ -84,6 +84,23 @@ public static function fix_query_pre_get_posts($wp_query) $wp_query->set('is_guest', $is_guest); } + /** + * Fix for publishpress author pages post type. + * + * @param WP_Query $wp_query Query object. + */ + public static function fix_frontend_query_pre_get_posts($wp_query) + { + if (is_string($wp_query) || empty($wp_query)) { + global $wp_query; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.VariableRedeclaration + } + + if (!is_admin() && $wp_query->is_main_query() && $wp_query->is_tax('author')) { + $selectedPostTypesForAuthorsPage = static::getSelectedPostTypesForAuthorsPage(); + $wp_query->set('post_type', $selectedPostTypesForAuthorsPage); + } + } + /** * Modify the WHERE clause on author queries. * @@ -96,7 +113,7 @@ public static function filter_author_posts_where($where, $query) { global $wpdb; - if (!$query->is_author()) { + if (!$query->is_author() && empty($query->query_vars['ppma_author'])) { return $where; } @@ -107,11 +124,11 @@ public static function filter_author_posts_where($where, $query) return $where; } - $author_name = sanitize_title($query->get('author_name')); + $author_name = !empty($query->query_vars['ppma_author']) + ? sanitize_title($query->get('ppma_author')) : sanitize_title($query->get('author_name')); if (empty($author_name)) { $author_id = (int)$query->get('author'); - $author = Author::get_by_id($author_id); if (!$author) { @@ -148,8 +165,7 @@ public static function filter_author_posts_where($where, $query) */ $current_user_id = get_current_user_id(); $current_author = Author::get_by_user_id($current_user_id); - if ( - $current_author + if ($current_author && is_object($current_author) && isset($current_author->term_id) && (int)$current_author->term_id > 0 @@ -160,7 +176,7 @@ public static function filter_author_posts_where($where, $query) } $where = preg_replace( '/\(?\b(?:' . $wpdb->posts . '\.)?post_author\s*(?:=|IN)\s*\(?(\d+)\)? AND (?:' . $wpdb->posts . '\.)?post_status = \'private\'/', - '(' . $maybe_both_query . ' ' . '' . $wpdb->term_taxonomy . '.taxonomy = "author" AND ' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$current_user_term_id . '\' ' . ' AND ' . $wpdb->posts . '.post_status = \'private\'', + '(' . $maybe_both_query . ' ' . ' ' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$current_user_term_id . '\' ' . ' AND ' . $wpdb->posts . '.post_status = \'private\'', $where, -1 ); @@ -170,7 +186,7 @@ public static function filter_author_posts_where($where, $query) */ $where = preg_replace( '/\(?\b(?:' . $wpdb->posts . '\.)?post_author\s*(?:=|IN)\s*\(?(\d+)\)?/', - '(' . $maybe_both_query . ' ' . '(' . $wpdb->term_taxonomy . '.taxonomy = "author" AND ' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$term->term_id . '\') ' . ')', + '(' . $maybe_both_query . ' ' . '(' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$term->term_id . '\') ' . ')', $where, -1 ); @@ -192,7 +208,7 @@ public static function filter_posts_join($join, $query) { global $wpdb; - if (!$query->is_author() || empty($query->authors_having_terms)) { + if ((!$query->is_author() && empty($query->query_vars['ppma_author'])) || empty($query->authors_having_terms)) { return $join; } @@ -226,7 +242,7 @@ public static function filter_posts_groupby($groupby, $query) { global $wpdb; - if (!$query->is_author() || empty($query->authors_having_terms)) { + if ((!$query->is_author() && empty($query->query_vars['ppma_author']))|| empty($query->authors_having_terms)) { return $groupby; } @@ -248,7 +264,7 @@ public static function filter_admin_posts_list_where($where, $query) { global $wpdb; - if (!isset($query->query_vars['author'])) { + if (!isset($query->query_vars['author']) && !isset($query->query_vars['ppma_author'])) { return $where; } @@ -259,7 +275,7 @@ public static function filter_admin_posts_list_where($where, $query) return $where; } - $author_id = (int)$query->get('author'); + $author_id = !empty($query->query_vars['ppma_author']) ? (int)$query->queried_object_id : (int)$query->get('author'); if (empty($author_id)) { return $where; @@ -269,8 +285,7 @@ public static function filter_admin_posts_list_where($where, $query) if (is_a($query->queried_object, 'WP_User')) { $author = Author::get_by_user_id($query->queried_object_id); } else { - $author = $query->queried_object; - + $author = !empty($query->query_vars['ppma_author']) ? Author::get_by_term_id($author_id) : $query->queried_object; if (!is_a($author, Author::class)) { return $where; } @@ -280,15 +295,14 @@ public static function filter_admin_posts_list_where($where, $query) return $where; } - $terms_implode = '(' . $wpdb->term_taxonomy . '.taxonomy = "author" AND ' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$author->getTerm()->term_id . '\') '; + $terms_implode = '(' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$author->getTerm()->term_id . '\') '; /** * Private post author regex */ $current_user_id = get_current_user_id(); $current_author = Author::get_by_user_id($current_user_id); - if ( - $current_author + if ($current_author && is_object($current_author) && isset($current_author->term_id) && (int)$current_author->term_id > 0 @@ -299,7 +313,7 @@ public static function filter_admin_posts_list_where($where, $query) } $where = preg_replace( '/\(?\b(?:' . $wpdb->posts . '\.)?post_author\s*(?:=|IN)\s*\(?(\d+)\)? AND (?:' . $wpdb->posts . '\.)?post_status = \'private\'/', - '(' . '' . $wpdb->term_taxonomy . '.taxonomy = "author" AND ' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$current_user_term_id . '\' ' . ' AND ' . $wpdb->posts . '.post_status = \'private\'', + '(' . '' . $wpdb->term_taxonomy . '.term_id = \'' . (int)$current_user_term_id . '\' ' . ' AND ' . $wpdb->posts . '.post_status = \'private\'', $where, -1 ); @@ -371,7 +385,7 @@ public static function filter_posts_list_join($join, $query) { global $wpdb; - if (!isset($query->query_vars['author'])) { + if (!isset($query->query_vars['author']) && !isset($query->query_vars['ppma_author'])) { return $join; } @@ -382,7 +396,7 @@ public static function filter_posts_list_join($join, $query) return $join; } - $author_id = (int)$query->get('author'); + $author_id = !empty($query->query_vars['ppma_author']) ? (int)$query->queried_object_id : (int)$query->get('author'); if (empty($author_id)) { return $join; @@ -391,7 +405,7 @@ public static function filter_posts_list_join($join, $query) if (is_a($query->queried_object, 'WP_User')) { $author = Author::get_by_user_id($query->queried_object_id); } else { - $author = $query->queried_object; + $author = !empty($query->query_vars['ppma_author']) ? Author::get_by_term_id($author_id) : $query->queried_object; } if (!is_object($author) || is_wp_error($author)) { @@ -429,7 +443,7 @@ public static function filter_posts_list_groupby($groupby, $query) { global $wpdb; - if (!isset($query->query_vars['author'])) { + if (!isset($query->query_vars['author']) && !isset($query->query_vars['ppma_author'])) { return $groupby; } @@ -440,7 +454,7 @@ public static function filter_posts_list_groupby($groupby, $query) return $groupby; } - $author_id = (int)$query->get('author'); + $author_id = !empty($query->query_vars['ppma_author']) ? (int)$query->queried_object_id : (int)$query->get('author'); if (empty($author_id)) { return $groupby; @@ -449,7 +463,7 @@ public static function filter_posts_list_groupby($groupby, $query) if (is_a($query->queried_object, 'WP_User')) { $author = Author::get_by_user_id($query->queried_object_id); } else { - $author = $query->queried_object; + $author = !empty($query->query_vars['ppma_author']) ? Author::get_by_term_id($author_id) : $query->queried_object; } if (!is_object($author) || is_wp_error($author)) { diff --git a/src/core/Classes/Utils.php b/src/core/Classes/Utils.php index f66618db..9b68b9d1 100644 --- a/src/core/Classes/Utils.php +++ b/src/core/Classes/Utils.php @@ -814,4 +814,166 @@ public static function sanitizeArray($array) return $sanitizedArray; } + + /** + * Helper function to check if template exist in theme/child theme. + * We couldn't use wordpress locate_template() as it support theme compact which load + * default template for files like sidebar.php even if it doesn't exist in theme + * + * @param array $template + * @return mixed + */ + public static function authors_locate_template($template_names) + { + $template = false; + + foreach ((array) $template_names as $template_name) { + if (!$template_name ) { + continue; + } + if (file_exists(STYLESHEETPATH . '/' . $template_name)) { + $template = STYLESHEETPATH . '/' . $template_name; + break; + } elseif (file_exists(TEMPLATEPATH . '/' . $template_name)) { + $template = TEMPLATEPATH . '/' . $template_name; + break; + } + } + + return $template; + } + + /** + * Get article excerpt + * + * @param integer $limit + * @param string $source + * @param boolean $echo + * @param boolean $read_more_link + * @return string + */ + public static function ppma_article_excerpt($limit, $source = null, $echo = false, $read_more_link = false) + { + + $excerpt = $source == "content" ? get_the_content() : get_the_excerpt(); + $excerpt = preg_replace(" (\[.*?\])",'',$excerpt); + $excerpt = strip_shortcodes($excerpt); + $excerpt = wp_strip_all_tags($excerpt); + $excerpt = substr($excerpt, 0, $limit); + $excerpt = substr($excerpt, 0, strripos($excerpt, " ")); + $excerpt = trim(preg_replace('/\s+/', ' ', $excerpt)); + if (!empty(trim($excerpt))) { + $excerpt .= '... '; + } + if ($read_more_link) { + $excerpt .= ''. esc_html__('Read more.', 'publishpress-authors') .''; + } + + if ($echo) { + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo $excerpt; + } else { + return $excerpt; + } + } + + /** + * Check if current active theme is block theme/support full site editing + * + * @return bool + */ + public static function ppma_is_block_theme() + { + + $is_block_theme = false; + + if (function_exists('wp_is_block_theme') + && function_exists('block_template_part') + && wp_is_block_theme() + ) { + $is_block_theme = true; + } + + return $is_block_theme; + } + + /** + * Retreive block theme header + * + * @return string + */ + public static function ppma_get_block_theme_header() + { + + $block_theme_header = ''; + + if (self::ppma_is_block_theme()) { + $header_template_part = get_block_template(get_stylesheet() . '//header', 'wp_template_part'); + if ($header_template_part && isset($header_template_part->content)) { + $block_theme_header = do_blocks($header_template_part->content); + } + } + + return $block_theme_header; + } + + /** + * Retreive block theme footer + * + * @return string + */ + public static function ppma_get_block_theme_footer() + { + + $block_theme_footer = ''; + + if (self::ppma_is_block_theme()) { + $footer_template_part = get_block_template(get_stylesheet() . '//footer', 'wp_template_part'); + if ($footer_template_part && isset($footer_template_part->content)) { + $block_theme_footer = do_blocks($footer_template_part->content); + } + } + + return $block_theme_footer; + } + + /** + * Format block theme header + * + * @return void + */ + public static function ppma_format_block_theme_header() + { + $fse_header = self::ppma_get_block_theme_header(); + $fse_footer = self::ppma_get_block_theme_footer();//we need to get footer as well before wp_head() call to enable fse css generator + ?> + + > +
+ + + + > + +