has_api_key_and_secret() ) { $this->api = new ConvertKit_API( $settings->get_api_key(), $settings->get_api_secret(), $settings->debug_enabled(), $context ); } // Call parent initialization function. parent::init(); } /** * Returns all non-inline forms based on the sort order. * * @since 2.2.4 * * @return bool|array */ public function get_non_inline() { // If the ConvertKit WordPress Libraries are < 1.3.6 (e.g. loaded by an outdated // addon), or a WordPress site updates this Plugin before other ConvertKit Plugins, // get_by() won't be available and will cause an E_ERROR, crashing the site. // @see https://wordpress.org/support/topic/error-1795/. if ( ! method_exists( $this, 'get_by' ) ) { return false; } return $this->get_by( 'format', array( 'modal', 'slide in', 'sticky bar' ) ); } /** * Returns whether any non-inline forms exist in the options table. * * @since 2.2.4 * * @return bool */ public function non_inline_exist() { if ( ! $this->get_non_inline() ) { return false; } return true; } /** * Returns a CSS class(es). * @param string $selected_option ', esc_attr( $value ), selected( $selected_option, $value, false ), esc_attr( $label ) ); } } // Iterate through resources, if they exist, building ', esc_attr( $form['id'] ), selected( $selected_option, $form['id'], false ), esc_attr( $form['name'] ), ( ! empty( $form['format'] ) ? esc_attr( $form['format'] ) : 'inline' ) ); } } // Close select. $html .= ''; // If no description is provided, return the select field now. if ( ! $description ) { return $html; } // Append description before returning field. if ( ! is_array( $description ) ) { return $html . '

' . $description . '

'; } // Return description lines in a paragraph, using breaklines for each description entry in the array. return $html . '

' . implode( '
', $description ) . '

'; } /** * Returns the HTML/JS markup for the given Form ID. * * Legacy Forms will return HTML. * Current Forms will return a '; } }