Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > > content-control > inc > functions
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
back-compat.php | File | 4300 bytes | October 01 2023 13:39:02. | |
compatibility.php | File | 6294 bytes | June 21 2024 13:00:36. | |
content.php | File | 3218 bytes | October 26 2023 13:40:28. | |
developers.php | File | 10976 bytes | June 21 2024 13:00:36. | |
globals.php | File | 1889 bytes | June 21 2024 13:00:36. | |
install.php | File | 2216 bytes | March 11 2025 14:19:36. | |
options.php | File | 4105 bytes | August 18 2024 09:36:48. | |
post-restrictions.php | File | 900 bytes | June 21 2024 13:00:36. | |
protections.php | File | 2250 bytes | September 18 2023 05:47:10. | |
query.php | File | 13898 bytes | March 15 2025 12:03:42. | |
restrictions.php | File | 6168 bytes | June 21 2024 13:00:36. | |
rule-callbacks.php | File | 20563 bytes | May 09 2025 02:30:24. | |
rules.php | File | 2539 bytes | May 09 2025 02:30:24. | |
term-restrictions.php | File | 905 bytes | June 21 2024 13:00:36. | |
upgrades.php | File | 4835 bytes | December 08 2023 15:26:30. | |
utils.php | File | 584 bytes | March 18 2024 03:33:26. | |
widgets.php | File | 1454 bytes | December 08 2023 15:26:30. |
<?php /** * Content helper functions. * * @package ContentControl * @since 2.0.0 * @copyright (c) 2023 Code Atlantic LLC */ namespace ContentControl; /** * Get post excerpt or <!--more--> tag content for a post. * * This differs from get_the_excerpt in that it will return the content * before the <!--more--> tag if it exists, but not generate an excerpt * from the_contnet. It also doesn't filter the content. * * @param int|\WP_Post|null $post_id Post ID or object. Defaults to global $post. * @return string */ function get_excerpt_by_id( $post_id = null ) { $post = get_post( $post_id ); $excerpt = ''; if ( $post ) { if ( has_excerpt( $post ) ) { // Use the excerpt if it's set. $excerpt = $post->post_excerpt; } else { // Otherwise, use the content before the 'more' tag. $content = $post->post_content; $more_position = strpos( $content, '<!--more-->' ); if ( false !== $more_position ) { // If there's a 'more' tag, return everything before it. $excerpt = substr( $content, 0, $more_position ); } } } return $excerpt; } /** * Filter feed post content when needed. * * @param string $content Content to display. * @param \ContentControl\Models\Restriction $restriction Restriction object. * * @return string */ function append_post_excerpts( $content, $restriction ) { global $post; if ( $restriction->show_excerpts() ) { // Get unfiltered excerpt. $excerpt = get_excerpt_by_id( $post ); if ( ! empty( $excerpt ) ) { /** * Filter the allowed tags for excerpts. * * @param string $tags Allowed tags. * * @return string */ $tags = apply_filters( 'content_control/excerpt_allowed_tags', '<a><em><strong><blockquote><ul><ol><li><p>' ); // Strip tags from excerpt. $excerpt = wp_kses( $excerpt, $tags ); // Wrap excerpt in div with class. $excerpt = '<div class="cc-content-excerpt">' . $excerpt . '</div>'; // Prepend excerpt to content. $content = $excerpt . $content; } } return $content; } /** * Apply content filters for the_content without our own again. * * @param string $content Content to display. * * @return string */ function the_content_filters( $content ) { return apply_filters( 'the_content', $content ); } /** * Apply get_the_excerpt fitlers without our own again. * * @param string $excerpt Excerpt to display. * * @return string */ function the_excerpt_filters( $excerpt ) { global $post; return apply_filters( 'get_the_excerpt', $excerpt, $post ); } /** * Get the current page URL. * * @return string */ function get_current_page_url() { global $wp; $current_page = trailingslashit( home_url( $wp->request ) ); /* phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash */ return add_query_arg( $_SERVER['QUERY_STRING'], '', $current_page ); /* phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash */ }
SILENT KILLER Tool