REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.22 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Newsletter/Editor/MetaInformationManager.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Newsletter\Editor; if (!defined('ABSPATH')) exit; use MailPoet\WP\Functions as WPFunctions; class MetaInformationManager { public function appendMetaInformation($content, $post, $args) { // Append author and categories above and below contents foreach (['above', 'below'] as $position) { $positionField = $position . 'Text'; $text = []; if (isset($args['showAuthor']) && $args['showAuthor'] === $positionField) { $text[] = self::getPostAuthor( $post->post_author, // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps $args['authorPrecededBy'] ); } if (isset($args['showCategories']) && $args['showCategories'] === $positionField) { $text[] = self::getPostCategories( $post->ID, $post->post_type, // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps $args['categoriesPrecededBy'] ); } if (!empty($text)) { $text = '<p>' . implode('<br />', $text) . '</p>'; if ($position === 'above') $content = $text . $content; else if ($position === 'below') $content .= $text; } } return $content; } private static function getPostCategories($postId, $postType, $precededBy) { $precededBy = trim($precededBy); // Get categories $categories = WPFunctions::get()->wpGetPostTerms( $postId, ['category'], ['fields' => 'names'] ); if (!empty($categories)) { // check if the user specified a label to be displayed before the author's name if (strlen($precededBy) > 0) { $content = stripslashes($precededBy) . ' '; } else { $content = ''; } return $content . join(', ', $categories); } else { return ''; } } private static function getPostAuthor($authorId, $precededBy) { $authorName = WPFunctions::get()->getTheAuthorMeta('display_name', (int)$authorId); $precededBy = trim($precededBy); if (strlen($precededBy) > 0) { $authorName = stripslashes($precededBy) . ' ' . $authorName; } return $authorName; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LayoutHelper.php
819 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MetaInformationManager.php
2.22 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostContentManager.php
4.82 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostListTransformer.php
772 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostTransformer.php
5.13 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
PostTransformerContentsExtractor.php
6.57 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
StructureTransformer.php
3.93 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TitleListTransformer.php
1.25 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Transformer.php
625 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).