function hook_social_content_info in Social Content 7
Define social content types.
This hook enables modules to register their own social content imports.
All social content imports inherit a set of common settings and options. Additional settings and a settings form can be defined in this hook.
$return $info An array of social content types, keyed by their name. With the following key values.
- title (required): The human readable name of the import. Wrap in t()
- content_type (required): The node content type that will be used for this import.
- external_id_field_mapping (required): An array for mapping the id field name from the social content website. In the form of: array('remote_id_field' => 'local_id_field')
- data_callback (required): Callback function for returning data.
- post_callback: Callback function for processing each post (row).
- settings_form: Callback function for modidying the settings form. All additional settings (defined in "additional settings" below) should be implemented in this form.
- additional_settings: An array of additional settings. In the form of array('variable name' => 'default value') All social content types receive the following variables: array( 'limit' => 0, // (number of items per import, 0 for no limit) 'auto_publish' => 1 // (whether posts should be published by default) 'enabled' => 0, // (whether this import should run on cron) )
3 functions implement hook_social_content_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- social_content_facebook_social_content_info in modules/
facebook/ social_content_facebook.module - @file Social Content: Facebook module.
- social_content_instagram_social_content_info in modules/
instagram/ social_content_instagram.module - social_content_twitter_social_content_info in modules/
twitter/ social_content_twitter.module
1 invocation of hook_social_content_info()
- social_content_get_types in ./
social_content.module - Gets all social content types.
File
- ./
social_content.api.php, line 40 - Hooks provided by Social Content module
Code
function hook_social_content_info() {
$info = array();
$info['facebook'] = array(
'title' => t('Facebook'),
'content_type' => 'facebook',
'external_id_field_mapping' => array(
'id' => 'field_facebook_external_id',
),
'data_callback' => 'social_content_facebook_data_callback',
'post_callback' => 'social_content_facebook_post_callback',
'settings_form' => 'social_content_facebook_settings_form',
'additional_settings' => array(
'user_id' => '',
'graph_url' => 'https://graph.facebook.com',
'access_token' => '',
'min_resolution' => '',
),
);
return $info;
}