publish ) || $_oPostCount->publish > 0 ) { return; } // Otherwise, create one. $_iPostID = $this->___createDefaultButton(); // Update the button CSS option. if ( $_iPostID ) { update_option( AmazonAutoLinks_Registry::$aOptionKeys[ 'button_css' ], AmazonAutoLinks_PluginUtility::getCSSRulesOfActiveButtons() // data ); } } /** * @since 3 * @since 3.6.2 Made it return the created post ID. * @return integer The created post ID. `0` for failing. */ private function ___createDefaultButton() { $_iPostID = $this->createPost( AmazonAutoLinks_Registry::$aPostTypes[ 'button' ], array( // post columns 'post_title' => __( 'Default', 'amazon-auto-links' ), ), array( // meta 'button_label' => __( 'Buy Now', 'amazon-auto-links' ), ) ); if( $_iPostID ) { update_post_meta( $_iPostID, // post id 'button_css', // meta key AmazonAutoLinks_ButtonResourceLoader::getDefaultButtonCSS( $_iPostID ) // value ); } return ( integer ) $_iPostID; } }