src/ElementBase.php
public function publishPage()
    {
        $look = true;
        $parent = $this;
        while($look)
        {
            if ($parent = $parent->getHolder())
            {
                if (is_a($parent, SiteTree::class))
                {
                    $look = false;
                }
            } else {
                $look = false;
            }
        }

        if ($parent->doPublish())
        {
            return _t(__CLASS__ . '.PageAndElementsPublished', 'Page & elements published');
        }
        return _t(__CLASS__ . '.PageAndElementsPublishError', 'There was an error publishing the page');
    }
public function publishPage()
    {
        $look = true;
        $parent = $this;
        while($look)
        {
            if ($parent = $parent->getHolder())
            {
                if (is_a($parent, SiteTree::class))
                {
                    $look = false;
                }
            } else {
                $look = false;
            }
        }

        if ($parent->doPublish())
        {
            return _t(__CLASS__ . '.PageAndElementsPublished', 'Page & elements published');
        }
        return _t(__CLASS__ . '.PageAndElementsPublishError', 'There was an error publishing the page');
    }
public function publishPage ( ) { $ look = true ; $ parent = $ this ; while ( $ look ) { if ( $ parent = $ parent -> getHolder ( ) ) { if ( is_a ( $ parent , SiteTree :: class ) ) { $ look = false ; } } else { $ look = false ; } } if ( $ parent -> doPublish ( ) ) { return _t ( __CLASS__ . '.PageAndElementsPublished' , 'Page & elements published' ) ; } return _t ( __CLASS__ . '.PageAndElementsPublishError' , 'There was an error publishing the page' ) ; }
Publish holder page, trigger publish all sub elements.
Publish holder page trigger publish all sub elements .