Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Dein Benutzer-Profil um weitere Social Media Accounts erweitern

<?php
/**
 * Managing contact fields for author bio
 */
$evolution_pro_Contactfields = new evolution_pro_Contactfields(
// Fehlende Accounts kannst du leicht ergänzen
       array (
    'Feed',
    'Twitter',
        'Facebook',
        'GooglePlus',
        'Flickr',
        'Xing',
        'Github',
        'Instagram',
        'LinkedIn',
        'Pinterest',
        'Vimeo',
        'Youtube'
    )
);
class evolution_pro_Contactfields {
    public
        $new_fields
    ,   $active_fields
    ,   $replace
    ;
    /**
     * @param array $fields New fields: array ('Twitter', 'Facebook')
     * @param bool $replace Replace default fields?

     */
    public function __construct($fields, $replace = TRUE)
    {
        foreach ( $fields as $field )
        {
            $this->new_fields[ mb_strtolower($field, 'utf-8') ] = $field;
        }
        $this->replace = (bool) $replace;
        add_filter('user_contactmethods', array( $this, 'add_fields' ) );
    }
    /**
     * Changing contact fields
     * @param  $original_fields Original WP fields
     * @return array
     */
    public function add_fields($original_fields)
    {
        if ( $this->replace )
        {
            $this->active_fields = $this->new_fields;
            return $this->new_fields;
        }
        $this->active_fields = array_merge($original_fields, $this->new_fields);
        return $this->active_fields;
    }
    /**
     * Helper function
     * @return array The currently active fields.

     */
    public function get_active_fields()
    {
        return $this->active_fields;
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: DateTimeZone not found laravel 
Php :: pakistan standard time zone 
Php :: PHP OOP - Interfaces 
Php :: php tutorials account ledger 
Php :: php check if variable is true or false 
Php :: how to add posts to php 
Php :: what is the fee/commission charge for payoneer 
Php :: how to generate unique alphanumeric 6 digit code through php myadmin 
Php :: php division without round 
Php :: laravel Join columns of Day, Month , Year to calculate age 
Php :: php receive get 
Php :: how we generate a single column migration in laravel 
Php :: write to error log opencart 
Php :: larave per page int returns string 
Php :: bu7scador con laravel 
Php :: Argument 1 passed to IlluminateDatabaseGrammar::parameterize() 
Php :: fuzzy search in php with percentage 
Php :: php how to use multi byte functions 
Php :: php 5.6 xampp 
Php :: tcpdf Array and string offset access syntax with curly braces is deprecated 
Php :: switch php version ubuntu 20.04 site:stackoverflow.com 
Php :: New in initializers - PHP 8.1 
Php :: DB::raw update query in laravel 
Php :: nl_langinfo — Query language and locale information 
Php :: Calling the JS file via WP PHP 
Php :: php: Güvenlik Fonksiyonu 
Php :: carbon 
Php :: eloquent complex queries 
Php :: "A non well formed numeric value encountered 
Php :: encode string for csv 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =