HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpwisesolutions/wp-content/themes/pofo/lib/pofo-excerpt.php
<?php
/**
 * Excerpt Class.
 *
 * @package Pofo
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) { exit; }

// Exerpt length
if( ! class_exists( 'Pofo_Excerpt' ) ){
    class Pofo_Excerpt {

        public static $length = 34;

        public static function pofo_get_by_length( $new_length = 34 ) {

            return Pofo_Excerpt::pofo_get( $new_length );
        }

        public static function pofo_get( $new_length ) {
            
            global $post;
            
            $pofo_output_data = '';
            $pofo_content = get_the_content();
            $pattern = get_shortcode_regex();
            
            if( $post->post_excerpt ){
                
                $pofo_output_data = $post->post_excerpt;

            } else {

                $sub_string = explode( '[vc_raw_html]', $pofo_content );
                $sub_string = ! empty( $sub_string['1'] ) ? explode( '[/vc_raw_html]', $sub_string['1'] ) : '';
                $sub_string = ! empty( $sub_string['0'] ) ? $sub_string['0'] : '';
                $pofo_content = str_replace( $sub_string, '', $pofo_content );
                $pofo_output_data = preg_replace_callback( "/$pattern/s", 'pofo_extract_shortcode_contents', $pofo_content );
            }
            if ( post_password_required() ) {

                $pofo_output_data = $pofo_content;

            } else {

                if( $new_length > 0 ) {
                    
                    $pofo_output_data = wp_trim_words( $pofo_output_data, $new_length, '...' );

                } else {

                    $pofo_output_data = wp_trim_words( $pofo_output_data, $new_length, '' );
                }
            }
            return $pofo_output_data;
        }
    }
}