Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get_page_content(FALSE)
#1
I need a function which returns whether the page has content or not. So i modified the function get_page_content() in this way

PHP Code:
function get_page_content($echo true) {
    global 
$content;
    
exec_action('content-top');
    
$content strip_decode($content);
    
$content exec_filter('content',$content);
    if(
getDef('GSCONTENTSTRIP',true)) $content strip_content($content);
    if (
$echo) {
        echo 
$content;
    } else {
        return 
$content;
    }
    
exec_action('content-bottom');

Can you include it in the core so that it can be called by get_page_content(FALSE)?

Thx

Alex
Reply
#2
Hi Alexander,

Thank you for showing your php code in this new use of the function get_page_content()

I think it would be better not to change anything in the GS core for maximum GS portability.

We can always write our own customized functions and put them inside
/theme/your_theme/functions.php

Grts,
F.
Reply
#3
(2019-10-23, 23:15:15)Felix Wrote: I think it would be better not to change anything in the GS core for maximum GS portability.

So do I - therefore i asked to include it in the GS core on next update :-)

Alex
Reply
#4
you can get page contents to put into a variable for testing and process without echoing it,using the function
returnPageContent()
PHP Code:
$stuff=returnPageContent('page_slug'); 
does this do what you want ?

lesh
Reply




Users browsing this thread: 1 Guest(s)