PHP code example of ralfhortt / wp-meta-box-contact

1. Go to this page and download the library: Download ralfhortt/wp-meta-box-contact 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/ */

    

ralfhortt / wp-meta-box-contact example snippets


new MetaBoxContact(
    array $screen = [],
    string $context = 'advanced',
    string $priority = 'default'
)

use RalfHortt\MetaBoxContact\MetaBoxContact;

PluginFactory::create()
    ->addService(MetaBoxContact::class, ['page'], 'advanced', 'default')
    ->boot();

use RalfHortt\MetaBoxContact\MetaBoxContact;

(new MetaBoxContact(['page'], 'advanced', 'default' ))->register();


$phone = get_post_meta( $post->ID, 'contact-phone', TRUE );
$fax = get_post_meta( $post->ID, 'contact-fax', TRUE );
$mobile = get_post_meta( $post->ID, 'contact-mobile', TRUE );
$email = get_post_meta( $post->ID, 'contact-email', TRUE );
$url = get_post_meta( $post->ID, 'contact-url', TRUE );


(new MetaBoxContact(['page'], 'advanced', 'default' ))->register();
add_filter('wp-meta-box-contact-url-page', '__return_false');