: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
// Exit if WP_Customize_Control does not exsist.
if ( ! class_exists( 'WP_Customize_Control' ) ) {
class PPW_Presets_Control extends WP_Customize_Control {
* @var string Control type
public $type = 'ppw-presets';
* Render the content on the theme customizer page.
public function render_content() {
if ( empty( $this->choices ) ) {
$name = 'password-protect-page_preset-' . $this->id; ?>
<span class="customize-control-title">
<?php echo esc_attr( $this->label ); ?>
<?php if ( ! empty( $this->description ) ) : ?>
<span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
<div id="input_<?php echo esc_attr( $this->id ); ?>" class="image">
<?php foreach ( $this->choices as $val ) : ?>
<div class="password-protect-page_thumbnail">
<input class="image-select" type="radio"
value="<?php echo esc_attr( $val['id'] ); ?>"
id="<?php echo esc_attr($this->id . $val['id']); ?>"
name="<?php echo esc_attr( $name ); ?>" <?php checked( $this->value(), $val['id'] ); ?> />
<label for="<?php echo esc_attr($this->id . $val['id']); ?>">
<div class="password-protect-page_thumbnail_img">
<img src="<?php echo esc_url($val['thumbnail']); ?>" alt="<?php echo esc_attr( $val['id'] ); ?>"
title="<?php echo esc_attr( $val['id'] ); ?>">
<h3><?php echo esc_html( $val['name'] ) ?></h3>
<input name='presets_hidden' type="hidden" <?php $this->link(); ?> value="<?php echo esc_attr( $this->value() ); ?>"/>
function ppw_presets_control_css() {
.customize-control-ppw-presets .image.ui-buttonset input[type=radio] {
.customize-control-ppw-presets .image.ui-buttonset label {
.customize-control-ppw-presets .image.ui-buttonset label.ui-state-active {
.customize-control-ppw-presets .customize-control-radio-buttonset label {
border-left: 1px solid #dedede;
.customize-control-ppw-presets label img {
#customize-controls .customize-control-ppw-presets label img {
.customize-control-ppw-presets label.ui-state-active img {
.customize-control-ppw-presets label.ui-state-hover img {
.customize-control-radio-buttonset label.ui-corner-left {
border-radius: 3px 0 0 3px;
.customize-control-radio-buttonset label.ui-corner-right {
border-radius: 0 3px 3px 0;
#customize-control-ppw_customize_presets_settings input[type=radio]{
#customize-control-ppw_customize_presets_settings label{
#customize-control-ppw_customize_presets_settings .password-protect-page_thumbnail{
border: 5px solid transparent;
-webkit-transition:all 0.2s ease-in-out;
-moz-transition:all 0.2s ease-in-out;
-ms-transition:all 0.2s ease-in-out;
transition:all 0.2s ease-in-out;
#customize-control-ppw_customize_presets_settings .password-protect-page_thumbnail:nth-child(odd){
#customize-control-ppw_customize_presets_settings .password-protect-page_thumbnail:nth-child(even){
#customize-control-ppw_customize_presets_settings .image:after{
#customize-control-ppw_customize_presets_settings h3{
font: 400 14px 'Open Sans', Arial, Helvetica, sans-serif;
#customize-control-ppw_customize_presets_settings label .password-protect-page_thumbnail_img:after {
#customize-control-ppw_customize_presets_settings label .password-protect-page_thumbnail_img:before {
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
-ms-transform-origin: left top;
-o-transform-origin: left top;
transform-origin: left top;
border-right: 3px solid white;
border-top: 3px solid white;
border-radius: 2.5px !important;
#customize-control-ppw_customize_presets_settings .password-protect-page_thumbnail_img{
#customize-control-ppw_customize_presets_settings input[type="radio"]:checked + label .password-protect-page_thumbnail_img:before {
-webkit-animation-delay: 100ms;
-moz-animation-delay: 100ms;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-webkit-animation-timing-function: ease;
-moz-animation-timing-function: ease;
animation-timing-function: ease;
-webkit-animation-name: checkmark;
-moz-animation-name: checkmark;
animation-name: checkmark;
-webkit-transform: scaleX(-1) rotate(135deg);
-moz-transform: scaleX(-1) rotate(135deg);
-ms-transform: scaleX(-1) rotate(135deg);
-o-transform: scaleX(-1) rotate(135deg);
transform: scaleX(-1) rotate(135deg);
-webkit-animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
animation-fill-mode: forwards;
#customize-control-ppw_customize_presets_settings input[type="radio"]:checked + label .password-protect-page_thumbnail_img:after{
#customize-control-ppw_customize_presets_settings img{
#customize-control-ppw_customize_presets_settings input[type="radio"]:checked + label img{
#customize-control-ppw_customize_presets_settings .password-protect-page_thumbnail:hover{
@-webkit-keyframes checkmark {
@-moz-keyframes checkmark {
add_action( 'customize_controls_print_styles', 'ppw_presets_control_css' );