ce. * * We have two separate methods for this. One for returning the HTML, and * one for echoing the html. This one echos it. * * @since 3.0.9 | 07 JUN 2018 | Created * @access public * @return string The modified string of notices' html. */ public function print_HTML() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid if ( ! $this->should_display_notice() ) : return; endif; if ( empty( $this->html ) ) : $this->render_HTML(); endif; echo $this->html; return $this; } /** * Checks whether a string is formatted as our default Date format. * * @since 3.0.9 | 08 JUN 2018 | Created * @param string $datetime The datetime string in question. * @return bool True iff the string is of the format 'Y-m-d h:i:s'. */ private function is_date( $datetime ) { return DateTime::createFromFormat( 'Y-m-d h:i:s', $datetime ) !== false; } /** * Prevents a CTA from being displayed on the notice. * * In cases where we require the user to take action, we need them * to follow the directions in the message before removing the notice. * * @since 3.1.0 | 05 JUL 2018 | Created the method. * @return SWP_Notice $this, for method chaining. */ public function remove_cta() { // * Force the ctas to an empty array so render can still loop over it. $this->actions = array(); $this->no_cta = true; return $this; } }