| @@ -717,8 +717,65 @@ | ||
| 717 | 717 | echo '<br class="clear"/>'; |
| 718 | 718 | } |
| 719 | 719 | |
| 720 | 720 | /** |
| 721 | + * Media input. | |
| 722 | + * | |
| 723 | + * @since 2.0 | |
| 724 | + * @deprecated 23.5 | |
| 725 | + * @codeCoverageIgnore | |
| 726 | + * | |
| 727 | + * @param string $variable Option name. | |
| 728 | + * @param string $label Label message. | |
| 729 | + * @param array $attr Extra attributes to add to the media input and buttons. | |
| 730 | + * | |
| 731 | + * @return void | |
| 732 | + */ | |
| 733 | + public function media_input( $variable, $label, $attr = [] ) { | |
| 734 | + | |
| 735 | + _deprecated_function( __METHOD__, 'Yoast SEO 23.5' ); | |
| 736 | + | |
| 737 | + $val = $this->get_field_value( $variable, '' ); | |
| 738 | + $id_value = $this->get_field_value( $variable . '_id', '' ); | |
| 739 | + | |
| 740 | + $var_esc = esc_attr( $variable ); | |
| 741 | + | |
| 742 | + $defaults = [ | |
| 743 | + 'disabled' => false, | |
| 744 | + ]; | |
| 745 | + $attr = wp_parse_args( $attr, $defaults ); | |
| 746 | + | |
| 747 | + $this->label( | |
| 748 | + $label, | |
| 749 | + [ | |
| 750 | + 'for' => 'wpseo_' . $variable, | |
| 751 | + 'class' => 'select', | |
| 752 | + ], | |
| 753 | + ); | |
| 754 | + | |
| 755 | + $id_field_id = 'wpseo_' . $var_esc . '_id'; | |
| 756 | + | |
| 757 | + echo '<span>'; | |
| 758 | + echo '<input', | |
| 759 | + ' class="textinput"', | |
| 760 | + ' id="wpseo_', $var_esc, '"', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- output escaped before. | |
| 761 | + ' type="text" size="36"', | |
| 762 | + ' name="', esc_attr( $this->option_name ), '[', $var_esc, ']"', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- output escaped before. | |
| 763 | + ' value="', esc_attr( $val ), '"', | |
| 764 | + ' readonly="readonly"', | |
| 765 | + ' /> '; | |
| 766 | + echo '<input', | |
| 767 | + ' type="hidden"', | |
| 768 | + ' id="', esc_attr( $id_field_id ), '"', | |
| 769 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- output escaped before. | |
| 770 | + ' name="', esc_attr( $this->option_name ), '[', $var_esc, '_id]"', | |
| 771 | + ' value="', esc_attr( $id_value ), '"', | |
| 772 | + ' />'; | |
| 773 | + echo '</span>'; | |
| 774 | + echo '<br class="clear"/>'; | |
| 775 | + } | |
| 776 | + | |
| 777 | + /** | |
| 721 | 778 | * Create a Radio input field. |
| 722 | 779 | * |
| 723 | 780 | * @since 2.0 |
| 724 | 781 | * |