ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﻞﺑﺎﻗ ﺍﺭ ﺩﺭﻮﺒﺷﺍﺩ ﺖﺠﯾﻭ


.ﺪﯿﻨﮐ ﻪﻓﺎﺿﺍ ﺩﺭﻮﺒﺷﺍﺩ ﺲﮐﺎﺑﺎﺘﻣ ﻦﯾﺍ ﻪﺑ ﺍﺭ ﻢﯿﻈﻨﺗ ﻞﺑﺎﻗ ﯼﺎﻫ ﻪﻨﯾﺰﮔ ﻪﻧﻮﮕﭼ ﻪﮐ ﻢﻫﺩ ﻥﺎﺸﻧ ﺎ

:ﻢﯿﻫﺩ ﻡﺎﺠﻧﺍ ﻢﯿﻫﺍﻮﺧ ﯽﻣ ﺎﻣ ﻪﮐ ﺖﺳﺍ ﯼﺭﺎﮐ ﻪﺠﯿﺘﻧ ﺎﺠﻨﯾﺍ ﺭﺩ

:ﺖﺳﺍ ﺮﺘﻣﺍﺭﺎﭘ 4 ﯼﺍﺭﺍﺩ()wp_add_dashboard_widget ،ﺎﺳﺎﺳﺍ .ﻢﯾﺩﻮﺑ ﻩﺩﺍﺪﻧ ﺶﺷﻮﭘ ﺍﺭ ﻊﺑﺎ

$widget_id

$widget_name

$Callback

$control_callback

.ﺪﻨﮐ ﯽﻣ ﺩﺎﺠﯾﺍ ﺲﮐﺎﺑﺎﺘﻣ ﻥﺍﻮﻨﻋ ﺭﺩ "ﯼﺪﻨﺑﺮﮑﯿﭘ" ﺪﻧﻮﯿﭘ ﮏﯾ ﺭﺎﮐﺩﻮﺧ ﺭﻮﻃ ﻪﺑ ،ﺪﯿﻫﺩ ﯽﻣ ﺭﺍﺮﻗ

ﺪﯿﻨﮐ ﺖﺒﺛ ﺍﺭ ﺕﺎﻤﯿﻈﻨﺗ ﺕﺎﻤﯿﻈﻨﺗ ﻊﺑﺎﺗ :1 ﻪﻠﺣﺮﻣ

:ﺪﺷﺎﺑ ﺮﯾﺯ ﺕﺭﻮﺻ ﻪﺑ ﺪﯾﺎﺑ ﺎﻤﺷ rc_mdm_register_widgets() ﻊﺑﺍﻮﺗ .ﺪ

/**
 * Register all dashboard metaboxes
 *
 * @access      public
 * @since       1.0 
 * @return      void
*/

function rc_mdm_register_widgets() {
	global $wp_meta_boxes;
	
	wp_add_dashboard_widget('widget_custom_rss', __('My RSS Feeds', 'rc_mdm'), 'rc_mdm_create_my_rss_box', 'rc_mdm_configure_my_rss_box');
}
add_action('wp_dashboard_setup', 'rc_mdm_register_widgets');

.ﻢﯾﺩﺮﮐ ﻪﻓﺎﺿﺍ ﺮﺘﻣﺍﺭﺎﭘ ﻦﯾﺮﺧﺁ ﻪﺑ ﺍﺭ "rc_mdm_configure_my_rss_box" ﯽﮔﺩﺎﺳ ﻪﺑ ﺎﻣ

ﺪﯿﻨﮐ ﺩﺎﺠﯾﺍ ﺍﺭ ﺕﺎﻤﯿﻈﻨﺗ ﺕﺎﻤﯿﻈﻨﺗ ﻊﺑﺎﺗ :2 ﻪﻠﺣﺮﻣ

.ﻢﯾﺩﺮﮐ ﻒﯾﺮﻌﺗ  ()wp_add_dashboard_widget ﺭﺩ ﻪﮐ ﺖﺳﺍ ﯼﺮﺘﻣﺍﺭﺎﭘ ﻦﯿﻣﺭﺎﻬﭼ ﻦﯾﺍ ؟ﺪﯿﺷﺎﺑ

/**
 * Creates the RSS metabox configuration settings
 *
 * @access      public
 * @since       1.0 
 * @return      void
*/
function rc_mdm_configure_my_rss_box( $widget_id ) {

	// Get widget options
	if ( !$rc_mdm_widget_options = get_option( 'rc_mdm_dashboard_widget_options' ) )
		$rc_mdm_widget_options = array();

	// Update widget options
	if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['rc_mdm_widget_post']) ) {
		update_option( 'rc_mdm_dashboard_widget_options', $_POST['rc_mdm_widget'] );
	}
	
	// Retrieve feed URLs
	$url_1 = $rc_mdm_widget_options['url_1'];
	$url_2 = $rc_mdm_widget_options['url_2'];
	$url_3 = $rc_mdm_widget_options['url_3']; ?>

	<p>
		<label for="rc_mdm_url_1-"><?php _e('Enter the RSS feed URL #1:', 'rc_mdm'); ?></label>
		<input class="widefat" id="rc_mdm_url_1" name="rc_mdm_widget[url_1]" type="text" value="<?php if( isset($url_1) ) echo $url_1; ?>" />
	</p>
	
	<p>
		<label for="rc_mdm_url_2"><?php _e('Enter the RSS feed URL #2:', 'rc_mdm'); ?></label>
		<input class="widefat" id="rc_mdm_url_2" name="rc_mdm_widget[url_2]" type="text" value="<?php if( isset($url_2) ) echo $url_2; ?>" />
	</p>
	
	<p>
		<label for="rc_mdm_url_3"><?php _e('Enter the RSS feed URL #3:', 'rc_mdm'); ?></label>
		<input class="widefat" id="rc_mdm_url_3" name="rc_mdm_widget[url_3]" type="text" value="<?php if( isset($url_3) ) echo $url_3; ?>" />
	</p>
	
	<input name="rc_mdm_widget_post" type="hidden" value="1" />
	<?php
} ?>

.ﺩﻮﺷ ﯽﻣ ﻩﺮﯿﺧﺫ ﺎﻣ ﯼﺎﻫ ﻪﻨﯾﺰﮔ SQL ﻝﻭﺪﺟ ﺭﺩ ﺪﯿﻓ ﯼﺎﻫ URL ﻩﺮﯿﺧﺫ ﻭ ﺎﻫﺪﻠﯿﻓ ﻥﺩﺮﮐ ﺮﭘ ﻡﺎﮕﻨ

ﺎﻫ ﻪﻨﯾﺰﮔ ﯽﺑﺎﯾﺯﺎﺑ :3 ﻪﻠﺣﺮﻣ

:ﺪﯿﻨﮐ ﻦﯾﺰﮕﯾﺎﺟ ﺍﺭ ﻥﺁ ﯽﮔﺩﺎﺳ ﻪﺑ .ﻢﯾﺩﺮﮐ ﻪﻓﺎﺿﺍ URL ﻭﺩ()rc_mdm_create_my_rss_box ﺭﺩ

// My feeds list
if ( !$my_feeds = get_option( 'rc_mdm_dashboard_widget_options' ) )
    $my_feeds = array();

.ﻢﯿﻨﮐ ﻪﻓﺎﺿﺍ ﺩﺭﻮﺒﺷﺍﺩ ﺖﺠﯾﻭ ﻪﺑ ﯽﺘﺣﺍﺭ ﻪﺑ ﺍﺭ ﯽﺷﺭﺎﻔﺳ ﯼﺎﻫﻪﻨﯾﺰﮔ ﻢﯾﺪﺷ ﻖﻓﻮﻣ ﺎﻣ !ﺲﺑ