当前位置 : 主页 > 网络编程 > PHP >

WordPress插件主程序(wp2wpqaq.php)

来源:互联网 收集:自由互联 发布时间:2021-06-28
WordPress同步插件的主程序,入口文件。 action){add_meta_box('wp2wp_view','WP2WPQAQ-synchronize','wp2wp_view','post','side','high');add_action('admin_enqueue_scripts','wp2wp_active_style');}}// Create a template...function wp2wp
WordPress同步插件的主程序,入口文件。
 action){
			add_meta_box('wp2wp_view','WP2WPQAQ-synchronize','wp2wp_view','post','side','high');
			add_action('admin_enqueue_scripts','wp2wp_active_style');
		}
	}

	// Create a template...
	function wp2wp_view(){
		?>
		
 
			
  
   
    ', 'wp2wpqaq');?>
      
  
			
   
  
			
  
			
  
		
 
		
 query( 'wp.getOptions', array( 0, $options['user'], $options['pass'], array( 'software_name', 'software_version', 'so_api' ) ) );
					$xmlrpcResponse = $xmlrpc->getResponse();
					if ( null == $xmlrpcResponse ) {
						if ( -32300 == $xmlrpc->getErrorCode() ) {
							$options['authenticated'] = false;
							$newOptions['group'][$groupId]['servers'][$serverKey]['api'] = 'API Unavailable';
						} else {
							$options['authenticated'] = false;
							$options['api'] = 'Unknown';
						}
					}else{
						if ( isset( $xmlrpcResponse['faultString'] ) ) {
							$options['authenticated'] = false;
							$options['api'] = __( trim( $xmlrpcResponse['faultString'], ' .' ), 'WP2WPQAQ' );
						}else{
							$options['authenticated'] = true;
							if ( isset( $xmlrpcResponse['so_api'] ) ) {
								$options['api'] = sprintf( __( 'WP2WPQAQ Synchronize API v%s', 'WP2WPQAQ' ), $xmlrpcResponse['so_api']['value'] );
							} else {
								$options['api'] = $xmlrpcResponse['software_name']['value'].' '.$xmlrpcResponse['software_version']['value'];
							}
						}
					}
				}
			}
		}
		return $options;
	}
	
	// Settings link on plugins page...
	function wp2wp_settings_link( $links, $file ) {
		if ( plugin_basename( __FILE__ ) == $file ) {
			array_push( $links, ''.__( 'Settings', 'wp2wpqaq' ).'' );
		}
		return $links;

	}
}
网友评论