WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Connect
BugFix annoying PHP notice (2 posts)

  1. railszilla
    Member
    Posted 1 year ago #

    in plugins/wordpress-connect/src/adminWordpressConnectAdminPanelLikeButton.php there is an undefined constant

    please add at line 39 as follow:

    register_setting( WPC_OPTIONS_LIKE_BUTTON, WPC_OPTIONS_LIKE_BUTTON, array( &$this, 'admin_like_button_settings_validate' ) );
    
    		// adds sections
    		add_settings_section( 'WPC_SETTINGS_SECTION_LIKE_BUTTON', __( 'Plugin Options', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_like_button' ), WPC_SETTINGS_LIKE_BUTTON_PAGE );
    		add_settings_section( 'WPC_SETTINGS_SECTION_LIKE_BUTTON_POSITION', __( 'Position Settings', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_like_button_position' ), WPC_SETTINGS_LIKE_BUTTON_PAGE );
    		add_settings_section( 'WPC_SETTINGS_SECTION_LIKE_BUTTON_ENABLED', __( 'Enable Settings', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_like_button_enable' ), WPC_SETTINGS_LIKE_BUTTON_PAGE );
    		add_settings_section( 'WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY', __( 'Display Settings', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_like_button_display' ), WPC_SETTINGS_LIKE_BUTTON_PAGE );
    
    		// like button settings
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_SEND', __( 'Send Button', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_send' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON );
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_LAYOUT', __( 'Layout Style', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_layout' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON );
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_WIDTH', __( 'Width', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_width' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON );
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_FACES', __( 'Show Faces', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_faces' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON );
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_VERB', __( 'Verb to display', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_verb' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON );
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_FONT', __( 'Font', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_font' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON );
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_REF', __( 'Ref', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_ref' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON );
    
    		// like button position settings
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_POSITION', __( 'Default Position', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_position_default' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, 'WPC_SETTINGS_SECTION_LIKE_BUTTON_POSITION' );
    
    		// like button enable settings
    		add_settings_field( 'WPC_OPTIONS_LIKE_BUTTON_ENABLED', __( 'Enabled', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_enabled' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_ENABLED );
    
    		// like button display settings
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_EVERYWHERE', __( 'Everywhere', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_everywhere' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_HOMEPAGE', __( 'Homepage', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_homepage' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_POSTS', __( 'Single Post', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_post' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_PAGES', __( 'Single Page', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_page' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_CATEGORIES', __( 'Categories', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_categories' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_TAGS', __( 'Tags', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_tags' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_SEARCH', __( 'Search', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_search' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_ARCHIVE', __( 'Archive', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_archive' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_NOWHERE', __( 'Nowhere', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_like_button_enable_nowhere' ), WPC_SETTINGS_LIKE_BUTTON_PAGE, WPC_SETTINGS_SECTION_LIKE_BUTTON_DISPLAY );

    this should fix the notice

  2. railszilla
    Member
    Posted 1 year ago #

    and please also use strings at line 42 in WordPressConnectAdminPanelComments.php

    // adds sections
    		add_settings_section( 'WPC_SETTINGS_SECTION_COMMENTS', __( 'Plugin Options', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_comments' ), WPC_SETTINGS_COMMENTS_PAGE );
    		add_settings_section( 'WPC_SETTINGS_SECTION_COMMENTS_POSITION', __( 'Position Settings', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_comments_position' ), WPC_SETTINGS_COMMENTS_PAGE );
    		add_settings_section( 'WPC_SETTINGS_SECTION_COMMENTS_ENABLED', __( 'Enable Settings', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_comments_enable' ), WPC_SETTINGS_COMMENTS_PAGE );
    		add_settings_section( 'WPC_SETTINGS_SECTION_COMMENTS_DISPLAY', __( 'Display Settings', WPC_TEXT_DOMAIN ), array( &$this, 'admin_section_comments_display' ), WPC_SETTINGS_COMMENTS_PAGE );
    
    		// comments settings
    		add_settings_field( 'WPC_OPTIONS_COMMENTS_NUMBER', __( 'Number of Comments', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_number' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS );
    		add_settings_field( 'WPC_OPTIONS_COMMENTS_WIDTH', __( 'Width', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_width' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS );
    
    		// comments position settings
    		add_settings_field( 'WPC_OPTIONS_COMMENTS_POSITION', __( 'Default Position', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_position_default' ), WPC_SETTINGS_COMMENTS_PAGE, 'WPC_SETTINGS_SECTION_COMMENTS_POSITION' );
    
    		// comments enable settings
    		add_settings_field( 'WPC_OPTIONS_COMMENTS_ENABLED', __( 'Enabled', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_enabled' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_ENABLED );
    
    		// comments display settings
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_EVERYWHERE', __( 'Everywhere', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_everywhere' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_HOMEPAGE', __( 'Homepage', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_homepage' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_POSTS', __( 'Single Post', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_post' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_PAGES', __( 'Single Page', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_page' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_CATEGORIES', __( 'Categories', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_categories' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_TAGS', __( 'Tags', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_tags' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_SEARCH', __( 'Search', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_search' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_ARCHIVE', __( 'Archive', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_archive' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );
    		add_settings_field( 'WPC_OPTIONS_DISPLAY_NOWHERE', __( 'Nowhere', WPC_TEXT_DOMAIN ), array( &$this, 'admin_setting_comments_enable_nowhere' ), WPC_SETTINGS_COMMENTS_PAGE, WPC_SETTINGS_SECTION_COMMENTS_DISPLAY );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic