1. Go to this page and download the library: Download inpsyde/more-menu-fields library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
inpsyde / more-menu-fields example snippets
Inpsyde\MoreMenuFields\bootstrap();
interface EditField {
public function name(): string;
public function field_markup(): string;
}
interface SanitizedEditField extends EditField {
public function sanitize_callback(): callable;
}
namespace My\Plugin;
class NofollowField implements Inpsyde\MoreMenuFields\SanitizedEditField
{
private $value;
public function __construct( Inpsyde\MoreMenuFields\EditFieldValue $value )
{
$this->value = $value;
}
public function name(): string
{
return 'nofollow';
}
public function field_markup(): string
{
if ( ! $this->value->is_valid() ) {
return '';
}
ob_start();